Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7670543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:50:47+00:00 2026-05-31T15:50:47+00:00

I am trying to port a Chrome plugin to Firefox using the addon-sdk and

  • 0

I am trying to port a Chrome plugin to Firefox using the addon-sdk and I cannot find an equivalent method to listen to tab navigation events.

What I need to do is keep data per page (detected from the DOM), and remove this as soon as the user navigates to a new page in the tab (but, maintain the data on refresh)

I Chrome, to do something when a tab changes URL, I can use:

chrome.tabs.onUpdated.addListener(function(tab_id, changeInfo, tab) {
    if(changeInfo.status == 'loading' && changeInfo.url) {
        //DO STUFF AS THE URL CHANGED
    }
});

In Firefox using the addon-sdk I have tried using:

tabs.on('open', function(tab){
  tab.on('ready', function(tab){
    if(tab.cachedURL != tab.url) {
      //DO STUFF AND SET CACHE
    }
  });
});

The problem is that I cannot hook into the initial navigation event, so in-between the user starting navigatiion and the DOM of the new page being ready, the old data is available.

Basically I need a way to hook into the initial navigation of a tab and ideally see where it’s going (just as I can in Chrome).

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:50:49+00:00Added an answer on May 31, 2026 at 3:50 pm

    At the moment there is no way to do detect page loading with tabs. However you can do it with the start event in page-mods. I’m also interested in doing this the right manner, so please ping me if you find a way without using page-mods:

    var pageMod = require("page-mod");
    pageMod.PageMod({
        include: "*", // All DOM windows (ie. all pages + all iframes).
        contentScriptWhen: "start", // page starts loading, at this point you have
                                    // the head of the document and no more
        contentScript: "", // inject no script, you can even omit this
        onAttach: function onAttach(worker) {
                if (worker.tab.url == worker.url) // test if at top level
                    doStuff(worker.tab.url);
                // cleanup the attached worker
                worker.destroy();
            }
        }
    );
    

    Also, I don’t know about the speed of the onAttach trigger, as with all message passing in ff extensions, it could add some time (maybe 150ms? please come back to me if you have a benchmark on this)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to port code over to compile using Microchip's C18 compiler for a
I'm trying to insert a video player plugin into the DOM using an object.
I'm trying to port of Chrome extension to Safari, not sure if it's actually
I am trying to create a chrome extension using HTML5 WebSockets and can't get
I'm trying to port an iPhone application from using SQLite to Core Data. Is
I'm trying to port my Chrome-extension to Opera. My extension does nothing else but
I'm trying port a GLSL 4.2 to 1.2 (Because I'm using a mac), however,
I'm currently trying to port an app from asp.net to php, however I just
I'm trying to port an application to the newest version of Mozilla Prism (1.0b1
I'm trying to port a Swing application to GWT. However lots of this application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.