@@ -18,6 +18,10 @@ const { BrowserTabsUtils } = ChromeUtils.importESModule(
18
18
"resource://gre/modules/BrowserTabsUtils.sys.mjs"
19
19
) ;
20
20
21
+ const { ProcessArguments } = ChromeUtils . importESModule (
22
+ "resource://gre/modules/ProcessArguments.sys.mjs"
23
+ ) ;
24
+
21
25
/**
22
26
* Clamps a number between a min and max value
23
27
* @param {number } value
@@ -445,7 +449,7 @@ BrowserTabs.prototype = {
445
449
* @param {boolean } [options.disableTRR] - Disables TRR for resolving host names
446
450
* @param {boolean } [options.forceAllowDataURI] - Allows for data: URI navigation
447
451
* @param {any } [options.postData] - The POST data to submit with the returned URI (see nsISearchSubmission).
448
- * @param {string } [options.initialBrowsingContextGroupId] - The initial browsing context group ID to use for the browser.
452
+ * @param {number } [options.initialBrowsingContextGroupId] - The initial browsing context group ID to use for the browser.
449
453
*/
450
454
createTab ( options ) {
451
455
if ( ! options . triggeringPrincipal ) {
@@ -928,6 +932,26 @@ BrowserTabs.prototype = {
928
932
}
929
933
} ,
930
934
935
+ /**
936
+ * Obtains the tab to adopt
937
+ * @returns {BrowserTab }
938
+ */
939
+ getTabToAdopt ( ) {
940
+ const { tabToAdopt } = ProcessArguments . getArguments ( this . _win ) ;
941
+
942
+ return tabToAdopt ;
943
+ } ,
944
+
945
+ /**
946
+ * Obtains the URI or URIs to load
947
+ * @returns {string | string[] }
948
+ */
949
+ getURIToLoad ( ) {
950
+ const { uriToLoad } = ProcessArguments . getArguments ( this . _win ) ;
951
+
952
+ return uriToLoad ;
953
+ } ,
954
+
931
955
/**
932
956
* Creates a browser for the initial load
933
957
*
@@ -950,7 +974,7 @@ BrowserTabs.prototype = {
950
974
}
951
975
952
976
// If we are providing a tab for adoption, make sure this is used
953
- const adoptedTab = this . _win . gDotInit . getTabToAdopt ( ) ;
977
+ const adoptedTab = this . getTabToAdopt ( ) ;
954
978
955
979
// If the adopted tab has a userContextId, we can use that instead
956
980
if ( adoptedTab && adoptedTab . hasAttribute ( "usercontextid" ) ) {
@@ -984,7 +1008,7 @@ BrowserTabs.prototype = {
984
1008
remoteType = E10SUtils . NOT_REMOTE ;
985
1009
}
986
1010
} else {
987
- let uriToLoad = this . _win . gDotInit . uriToLoadPromise ;
1011
+ let uriToLoad = this . getURIToLoad ( ) ;
988
1012
// If we have a URI to load, we only need the first item
989
1013
if ( uriToLoad && Array . isArray ( uriToLoad ) ) {
990
1014
uriToLoad = uriToLoad [ 0 ] ;
0 commit comments