Alternative to browser.tabs.onUpdated.addListener for Mobile

Hello there,

I am trying to make the browser.tabs.onUpdated.addListener function of the extension that I have developed, work also in the mobile version of the firefox browser. Is there an alternative, or something to make it work?

That should just work, what exactly is not working for you?

Hi,

The browser.tabs.onUpdated.addListener function works in the Firefox app, because I see the toolbar of the extension, as long as it is in desktop mode, however, in mobile version nothing appears. I would like to know if there is any alternative to the aforementioned function, which also works for the mobile version of Firefox.

It’s still hard to understand what exactly you’re trying to do. You have a browserAction? A pageAction? And it’s not showing up when it should?

The add-on that I developed for Firefox, makes it appear in the upper part of the browser, a toolbar with the search results (as it appears in the screenshot). In the web version of Firefox appears, while in the mobile version nothing appears. The function I use to make it appear is called browser.tabs.onUpdated.addListener, but apparently, when using the Firefox browser on a mobile or tablet, it does not even appear. And my question is if there is any alternative to the previously mentioned function, so that it also works in a mobile version.

How do you know browser.tabs.onUpdated is to blame here? Further, why do you even need it, can you not inject based on content script match patterns?

I just tried to remove the browser.tabs.onUpdated function, but in this way it does not work either in the web version of Firefox or in the mobile version of Firefox. Is there a similar function to the one I use but for the mobile version of Firefox?

onUpdated should work just as it does on desktop, but that does not explain what you need it for.

I ask the question in another way. How could a simple extension be created in which a toolbar appears at the top of the screen, which also works on mobile phones and tablets?

Using a content_script that matches all documents? Or just the pages that the toolbar should appear on and then that content script queries the background page for things it can’t do itself.

It would be using a js script as a background that runs when a page loads in Google, so that it works also in the mobile version of Firefox

No, I was saying, just have a content script that decides when to show the toolbar. Don’t decide that with triggers from the background page.

I need to know, how to make a Toolbar that appears at the top of the mobile screen, taking into account that to work, the user must download the extension.

Like Amazon, it has an extension, in which when you perform a search, a Toolbar appears at the top of the screen.

My question is how to make a JS Script, which makes a Toolbar appear at the top of the screen of a mobile phone, created from said JS Script.

You just have a content script that adds that. That’s all. I can repeat that a couple of times if you want to. You should not need tabs.onUpdated for that.

Without that function it does not work in the web version, because what I want is to load the toolbar for each time a user searches on Google. With the tabs function it does not work in the mobile version, but is there an alternative to the tabs function that does the same as that function but in the mobile version?