سؤال

I have the following in the background scope, it should print the active tab info to the console every 10 seconds:

appAPI.ready(function($) {

    // console information about active tab every 10 seconds
    appAPI.setInterval(function() {
        appAPI.tabs.getActive(function(tabInfo) {
            console.log(
                'tabId: ' + tabInfo.tabId +
                ' tabUrl: ' + tabInfo.tabUrl
            );
    });}, 10 * 1000);
});

And it doesn't give anything in the console, on the latest Chrome.

هل كانت مفيدة؟

المحلول

Are you checking Chrome's background console? For more information, see Viewing Messages in Chrome's Background Console.

FYI: I tested your code on the latest Chrome and it works as expected: Test Result

[Disclaimer: I am a Crossrider employee]

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top