devopera icon indicating copy to clipboard operation
devopera copied to clipboard

Update Omnibox extension tutorial

Open pepelsbey opened this issue 9 years ago • 0 comments

Reminder task. Since we won’t have URLs like this soon: dev.opera.com/extension-docs/search.html is would be good to update article and extension with something more universal. But not right now, only once new extensions docs are merged to master and deployed.

chrome.omnibox.onInputEntered.addListener(
    function(text) {
        var qString = 'http://dev.opera.com/extension-docs/search.html?q=' + encodeURIComponent(text);
        chrome.tabs.query({
            'currentWindow': true,
            'active': true
        }, function(tab) {
            chrome.tabs.update(
                tab[0].id, { 'url': qString }
            );
        });
    }
);

pepelsbey avatar Aug 06 '15 15:08 pepelsbey