2
submitted 2 years ago by [email protected] to c/[email protected]

I am using the Experimental API in my private Firefox extension.

So far, I've been using Firefox 102 ESR, but I'm planning to switch to Firefox ESR 115. There's already a Firefox 115 Beta available, so I've started testing it with my private extension.

So far, I've been using internal Firefox functions like loadOneTab and loadURI and it worked very well.

I used the loadOneTab function like this:

const placesURL = "chrome://browser/content/places/places.xhtml";
		window.gBrowser.loadOneTab( placesURL, {
			inBackground: false,
			allowThirdPartyFixup : true,
			relatedToCurrent : true,
			triggeringPrincipal : services.scriptSecurityManager.getSystemPrincipal()
		} );

But the loadOneTab function no longer exists at all in Firefox's internal API. What should I replace it with?

I found the function _createTab:

// window.gBrowser._createTab({ uriString: placesURL });

But the _createTab function returns an error:

Uncaught Error: UserInteraction with id "browser.tabs.opening" was not initialized

...I guess this is by security to make this function called only by user action? And I call this function inside async function.

Is it somehow possible to open a new tab from the Experimental API in Firefox 115 beta?
I need this very badly. Really very much.


I used the loadURI function like this:

window.gBrowser.selectedBrowser.loadURI(linkGo, {triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()});

The loadURI function appears to still be available in Firefox's internal API, but returns an error like this:

TypeError: 'uri' member of CancelContentJSOptions is not an object. RemoteWebNavigation.sys.mjs:28:41

How to overcome this error?

no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 18 Jun 2023
2 points (100.0% liked)

Firefox

20363 readers
48 users here now

/c/firefox

A place to discuss the news and latest developments on the open-source browser Firefox.


Rules

1. Adhere to the instance rules

2. Be kind to one another

3. Communicate in a civil manner


Reporting

If you would like to bring an issue to the moderators attention, please use the "Create Report" feature on the offending comment or post and it will be reviewed as time allows.


founded 5 years ago
MODERATORS