API Call 'tabs.reload' is not supported in Edge

External Issue #9107382

Details

Author
Emmanuel S.
Created
Sep 28, 2016
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

chrome.tabs.reload is not (yet) supported in EDGE extension (background).

It makes background job more complex than it should (but still feasible).
On extension installation, if you need to execute content scripts in tabs already loaded, and since the content_scriptsproperty is not applied on existing tabs, you have to query tabs and manually execute scripts (everything asynchronously, else that does not work).

Any reason EDGE does not support reload method?

Here is how we solved lack of reload method:

function executeScript(tabsArray, contentScripts, callback, j, k)
{
    if (j===undefined) j=0;
    if (k===undefined) k=0;

    if (j>tabsArray.length) {
        callback();
        return;
    }

    chrome.tabs.executeScript(
        tabsArray[j].id,
        {file:contentScripts[k], runAt:"document_idle"},
        function(result){
            if (k+1===contentScripts.length)
                executeScript(tabsArray, contentScripts, callback, ++j, 0);
            else executeScript(tabsArray, contentScripts, callback, j, ++k);
        }
    );
}

function reloadTabs(i)
{
    // EDGE : It seems array of urls for query is not implemented... we need to check each url pattern
var webmailsPatterns=[<your patterns list> eg "https://microsoft.com/*",...];

    try {
        if (i===undefined)
            i=0;
        if (i<webmailsPatterns.length)
        {
            chrome.tabs.query({"url":webmailsPatterns[i]}, function(tabsArray) {
                var contentScripts=[
                    "contentScriptsAPIBridge.js", // If it's a "chrome bridged extension"
                    0)
                    executeScript(tabsArray, contentScripts, function() {reloadTabs(i+1);});
                else reloadTabs(i+1);                   
            });
        }
        else chromeTabsReloaded=true;
    } catch (e) {
        console.error('Exception reloading tabs after onInstalled event',e);
    }
}

Attachments

0 attachments

    Comments and activity

    • Mistake in my sample code :
      var contentScripts=[
      "contentScriptsAPIBridge.js", // If it’s a “chrome bridged extension”
      )

    • Microsoft Edge Team

      Changed Assigned To to “Sebastian P.”

      Changed Status to “External”

    • This issue has been resolved External. This means this issue may require a new feature to be implemented or other work that is more significant than a typical bug. You may be able to find more information on this issue by searching for related features on status.microsoftedge.com and uservoice.microsoftedge.com.

    You need to sign in to your Microsoft account to add a comment.

    Sign in