# Funcions \`loadOneTab\` and \`loadURI\` in 2023 in Firefox Experimental API?

**URL:** <https://discourse.mozilla.org/t/funcions-loadonetab-and-loaduri-in-2023-in-firefox-experimental-api/120405>\
**Category:** Development\
**Created:** [June 18, 2023, 10:24am UTC](https://discourse.mozilla.org/t/funcions-loadonetab-and-loaduri-in-2023-in-firefox-experimental-api/120405 "2023-06-18T10:24:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![look997](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@look997](https://discourse.mozilla.org/u/look997)\
**Post date:** [June 18, 2023, 10:24am UTC](https://discourse.mozilla.org/t/funcions-loadonetab-and-loaduri-in-2023-in-firefox-experimental-api/120405/1 "2023-06-18T10:24:37Z")

</div>

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:

```auto
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`:

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

```

But the `_createTab` function returns an error:

```auto
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:

```auto
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:

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

```

How to overcome this error?

---

<div class="post-metadata">

**Author:** ![look997](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@look997](https://discourse.mozilla.org/u/look997)\
**Post date:** [June 18, 2023, 11:54am UTC](https://discourse.mozilla.org/t/funcions-loadonetab-and-loaduri-in-2023-in-firefox-experimental-api/120405/2 "2023-06-18T11:54:35Z")

</div>

I found a solution in the Firefox source code - `loadTabs`.

Instead of `loadOneTab` I used this:

```auto
window.gBrowser.loadTabs( [linkGo] , {
	inBackground: event.target.inBackground,
	relatedToCurrent: true,
	allowThirdPartyFixup: true,
	triggeringPrincipal: services.scriptSecurityManager.getSystemPrincipal()
} );

```

* * *

Instead of `loadURI` I used this:

```auto
window.gBrowser.loadTabs([linkGo], {
	replace: true,
	allowThirdPartyFixup: true,
	triggeringPrincipal: services.scriptSecurityManager.getSystemPrincipal()
});

```

…The key is `replace: true`, which makes the URI open in the currently open tab.

---

<div class="post-metadata">

**Author:** ![sdagfk](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sdagfk](https://discourse.mozilla.org/u/sdagfk)\
**Post date:** [November 16, 2025, 10:25pm UTC](https://discourse.mozilla.org/t/funcions-loadonetab-and-loaduri-in-2023-in-firefox-experimental-api/120405/3 "2025-11-16T22:25:36Z")

</div>

Had the same issue, slightly different solution because I don’t want to pass an array, but a simple string.

You can replace `loadOneTab` with `gBrowser.addTab`. [Bug 1475606](https://bugzilla.mozilla.org/show_bug.cgi?id=1475606) removed it.

You can replace `loadURI` with `openLinkIn`. [Bug 1815439](https://bugzilla.mozilla.org/show_bug.cgi?id=1815439) removed it. `openLinkIn` is defined in `/main/browser/base/content/utilityOverlay.js`[[1]](https://github.com/mozilla-firefox/firefox/blob/main/browser/base/content/utilityOverlay.js) and [global](https://github.com/mozilla-firefox/firefox/blob/main/browser/base/content/global-scripts.js).  
Example: `openLinkIn(url, "current", {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});`
