Can the extension detect the Google Chrome homepage?

Is there a way to discover the Google Chrome homepage using the chrome extension API. * or in any other way? Thank you

+3
source share
1 answer

There is no API call for this. The closest I could get was to launch chrome.tabs.getAllInWindowat the beginning of the background page and then analyze the returned tabs.

chrome.tabs.getAllInWindow(null, function(tabs) {
    if(tabs.length == 1 && tabs[0].status == "loading") {
        console.log("possible home page:", tabs[0].url);
    }
});

, , 1 , , URL-. , , , ( localStorage).

+4

Source: https://habr.com/ru/post/1792044/


All Articles