Chrome extension: how to get newly created tab urlHow do you get a timestamp in JavaScript?How to get the children of the $(this) selector?Get current URL with jQuery?How do I modify the URL without reloading the page?How can I get query string values in JavaScript?Get the current URL with JavaScript?How do I get the current date in JavaScript?Open a URL in a new tab (and not a new window) using JavaScriptHow to detect tabs change URLs or tabs create on Google Chrome Extension?capture URL in chrome extension

What is the purpose of using a decision tree?

What do the positive and negative (+/-) transmit and receive pins mean on Ethernet cables?

How to test the sharpness of a knife?

is this saw blade faulty?

Sort with assumptions

Can creatures abilities target that creature itself?

C++ lambda syntax

What is the period/term used describe Giuseppe Arcimboldo's style of painting?

Is there a distance limit for minecart tracks?

Calculate Pi using Monte Carlo

Taking the numerator and the denominator

Asserting that Atheism and Theism are both faith based positions

Why would five hundred and five same as one?

What (if any) is the reason to buy in small local stores?

How can a new country break out from a developed country without war?

Why didn’t Eve recognize the little cockroach as a living organism?

How do you say "Trust your struggle." in French?

Air travel with refrigerated insulin

categorizing a variable turns it from insignificant to significant

Offset in split text content

Do I have to take mana from my deck or hand when tapping this card?

How do I lift the insulation blower into the attic?

Why does the frost depth increase when the surface temperature warms up?

Output visual diagram of picture



Chrome extension: how to get newly created tab url


How do you get a timestamp in JavaScript?How to get the children of the $(this) selector?Get current URL with jQuery?How do I modify the URL without reloading the page?How can I get query string values in JavaScript?Get the current URL with JavaScript?How do I get the current date in JavaScript?Open a URL in a new tab (and not a new window) using JavaScriptHow to detect tabs change URLs or tabs create on Google Chrome Extension?capture URL in chrome extension













0















In my extension/addon background script I'm having issues trying to a new tab's url, it keeps coming back with 'about:blank', which is fair enough if it hasn't loaded properly yet.



My question is how do you get the url of a newly created tab as soon as it is ready?



browser.tabs.onCreated.addListener(function(tab) 
var m_Url = tab.url;
console.log("m_Url: " + m_Url);
);









share|improve this question

















  • 2





    Does it work better to use onUpdated and look for changeInfo.url changes?

    – Mattias Wadman
    Mar 7 at 0:53






  • 1





    Use onUpdated inside onCreated.

    – wOxxOm
    Mar 7 at 4:17















0















In my extension/addon background script I'm having issues trying to a new tab's url, it keeps coming back with 'about:blank', which is fair enough if it hasn't loaded properly yet.



My question is how do you get the url of a newly created tab as soon as it is ready?



browser.tabs.onCreated.addListener(function(tab) 
var m_Url = tab.url;
console.log("m_Url: " + m_Url);
);









share|improve this question

















  • 2





    Does it work better to use onUpdated and look for changeInfo.url changes?

    – Mattias Wadman
    Mar 7 at 0:53






  • 1





    Use onUpdated inside onCreated.

    – wOxxOm
    Mar 7 at 4:17













0












0








0








In my extension/addon background script I'm having issues trying to a new tab's url, it keeps coming back with 'about:blank', which is fair enough if it hasn't loaded properly yet.



My question is how do you get the url of a newly created tab as soon as it is ready?



browser.tabs.onCreated.addListener(function(tab) 
var m_Url = tab.url;
console.log("m_Url: " + m_Url);
);









share|improve this question














In my extension/addon background script I'm having issues trying to a new tab's url, it keeps coming back with 'about:blank', which is fair enough if it hasn't loaded properly yet.



My question is how do you get the url of a newly created tab as soon as it is ready?



browser.tabs.onCreated.addListener(function(tab) 
var m_Url = tab.url;
console.log("m_Url: " + m_Url);
);






javascript google-chrome-extension firefox-addon-sdk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 0:47









HankHank

1,19421959




1,19421959







  • 2





    Does it work better to use onUpdated and look for changeInfo.url changes?

    – Mattias Wadman
    Mar 7 at 0:53






  • 1





    Use onUpdated inside onCreated.

    – wOxxOm
    Mar 7 at 4:17












  • 2





    Does it work better to use onUpdated and look for changeInfo.url changes?

    – Mattias Wadman
    Mar 7 at 0:53






  • 1





    Use onUpdated inside onCreated.

    – wOxxOm
    Mar 7 at 4:17







2




2





Does it work better to use onUpdated and look for changeInfo.url changes?

– Mattias Wadman
Mar 7 at 0:53





Does it work better to use onUpdated and look for changeInfo.url changes?

– Mattias Wadman
Mar 7 at 0:53




1




1





Use onUpdated inside onCreated.

– wOxxOm
Mar 7 at 4:17





Use onUpdated inside onCreated.

– wOxxOm
Mar 7 at 4:17












1 Answer
1






active

oldest

votes


















1














Use onUpdated instead.



Check the doc https://developer.chrome.com/extensions/tabs#event-onUpdated




Fired when a tab is created. Note that the tab's URL may not be set at the time this event is fired, but you can listen to onUpdated events so as to be notified when a URL is set.




So, onUpdated event is the appropriate event in this case.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034415%2fchrome-extension-how-to-get-newly-created-tab-url%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Use onUpdated instead.



    Check the doc https://developer.chrome.com/extensions/tabs#event-onUpdated




    Fired when a tab is created. Note that the tab's URL may not be set at the time this event is fired, but you can listen to onUpdated events so as to be notified when a URL is set.




    So, onUpdated event is the appropriate event in this case.






    share|improve this answer



























      1














      Use onUpdated instead.



      Check the doc https://developer.chrome.com/extensions/tabs#event-onUpdated




      Fired when a tab is created. Note that the tab's URL may not be set at the time this event is fired, but you can listen to onUpdated events so as to be notified when a URL is set.




      So, onUpdated event is the appropriate event in this case.






      share|improve this answer

























        1












        1








        1







        Use onUpdated instead.



        Check the doc https://developer.chrome.com/extensions/tabs#event-onUpdated




        Fired when a tab is created. Note that the tab's URL may not be set at the time this event is fired, but you can listen to onUpdated events so as to be notified when a URL is set.




        So, onUpdated event is the appropriate event in this case.






        share|improve this answer













        Use onUpdated instead.



        Check the doc https://developer.chrome.com/extensions/tabs#event-onUpdated




        Fired when a tab is created. Note that the tab's URL may not be set at the time this event is fired, but you can listen to onUpdated events so as to be notified when a URL is set.




        So, onUpdated event is the appropriate event in this case.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 7 at 4:04









        balduranbalduran

        1205




        1205





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034415%2fchrome-extension-how-to-get-newly-created-tab-url%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

            Алба-Юлія

            Захаров Федір Захарович