Are there any way of enabling the search feature for vs code webview?

Issue

I am making an extension for VS Code where I show html5 articles in a webview.
I’ve noticed I can’t search through the document using the find (ctrl + f) feature.
I am wondering if there is any way to enable it, or maybe implement it using js/ts.
The best idea I’ve got so far is to detect if the user uses the ctrl + f shortcut and make my own search capabilities with window.find(). I’m not sure jet whether or not it will work, and it feels like an non optimal solution.
Are there any way of enabling the search feature for vs code webview?

Solution

Check the webview panel options when creating the webview:

    /**
     * Content settings for a webview panel.
     */
    export interface WebviewPanelOptions {
        /**
         * Controls if the find widget is enabled in the panel.
         *
         * Defaults to false.
         */
        readonly enableFindWidget?: boolean;

Answered By – Mike Lischke

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published