@@ -2383,73 +2383,66 @@ var gBrowserInit = {
2383
2383
2384
2384
/*** Floorp Injections *********************************************************************************************/
2385
2385
2386
- var { FloorpAppConstants } = ChromeUtils . importESModule (
2387
- "resource:///modules/FloorpAppConstants.sys.mjs"
2388
- ) ;
2386
+ if ( uri ) {
2387
+ try {
2388
+ // If the URI has "?FloorpEnableSSBWindow=true" at the end, The window will be opened as a SSB window.
2389
+ if ( uri . endsWith ( "?FloorpEnableSSBWindow=true" ) ) {
2390
+ let parseSsbArgs = uri . split ( "," ) ;
2391
+ let id = parseSsbArgs [ 1 ] ;
2389
2392
2390
- if ( FloorpAppConstants . FLOORP_OFFICIAL_COMPONENTS_ENABLED ) {
2391
- if ( uri ) {
2392
- try {
2393
- // If the URI has "?FloorpEnableSSBWindow=true" at the end, The window will be opened as a SSB window.
2394
- if ( uri . endsWith ( "?FloorpEnableSSBWindow=true" ) ) {
2395
- let parseSsbArgs = uri . split ( "," ) ;
2396
- let id = parseSsbArgs [ 1 ] ;
2393
+ // Replace start uri
2394
+ uri = parseSsbArgs [ 0 ] ;
2397
2395
2398
- // Replace start uri
2399
- uri = parseSsbArgs [ 0 ] ;
2396
+ document . documentElement . setAttribute (
2397
+ "FloorpEnableSSBWindow" ,
2398
+ "true"
2399
+ ) ;
2400
2400
2401
- document . documentElement . setAttribute (
2402
- "FloorpEnableSSBWindow ",
2403
- "true"
2404
- ) ;
2401
+ document . documentElement . setAttribute (
2402
+ "FloorpSSBId ",
2403
+ id
2404
+ ) ;
2405
2405
2406
- document . documentElement . setAttribute (
2407
- "FloorpSSBId" ,
2408
- id
2409
- ) ;
2406
+ // Add SSB Window or Tab Attribute
2407
+ // This attribute is used to make do not restore the window or tab when the browser is restarted.
2408
+ window . floorpSsbWindow = true ;
2410
2409
2411
- // Add SSB Window or Tab Attribute
2412
- // This attribute is used to make do not restore the window or tab when the browser is restarted.
2413
- window . floorpSsbWindow = true ;
2414
-
2415
- SessionStore . promiseInitialized . then ( ( ) => {
2416
- // Load SSB Support Script & CSS
2417
- gBrowser . tabs . forEach ( tab => {
2418
- tab . setAttribute ( "floorpSSB" , "true" ) ;
2419
- } ) ;
2420
- window . gBrowser . floorpSsbWindow = true ;
2421
- Services . scriptloader . loadSubScript (
2422
- "chrome://browser/content/browser-ssb-support.js" ,
2423
- this
2424
- ) ;
2410
+ SessionStore . promiseInitialized . then ( ( ) => {
2411
+ // Load SSB Support Script & CSS
2412
+ gBrowser . tabs . forEach ( tab => {
2413
+ tab . setAttribute ( "floorpSSB" , "true" ) ;
2425
2414
} ) ;
2426
- }
2427
- } catch ( e ) {
2428
- console . error ( e ) ;
2415
+ window . gBrowser . floorpSsbWindow = true ;
2416
+ Services . scriptloader . loadSubScript (
2417
+ "chrome://browser/content/browser-ssb-support.js" ,
2418
+ this
2419
+ ) ;
2420
+ } ) ;
2429
2421
}
2422
+ } catch ( e ) {
2423
+ console . error ( e ) ;
2430
2424
}
2425
+ }
2431
2426
2432
- const SsbPrefName = "browser.ssb.startup" ;
2433
- let needSsbOpenWindow = Services . prefs . prefHasUserValue ( SsbPrefName ) ;
2434
- if ( needSsbOpenWindow ) {
2435
- let id = Services . prefs . getStringPref ( SsbPrefName ) ;
2436
- var { SiteSpecificBrowserIdUtils } = ChromeUtils . import (
2437
- "resource:///modules/SiteSpecificBrowserIdUtils.jsm"
2438
- ) ;
2427
+ const SsbPrefName = "browser.ssb.startup" ;
2428
+ let needSsbOpenWindow = Services . prefs . prefHasUserValue ( SsbPrefName ) ;
2429
+ if ( needSsbOpenWindow ) {
2430
+ let id = Services . prefs . getStringPref ( SsbPrefName ) ;
2431
+ var { SiteSpecificBrowserIdUtils } = ChromeUtils . import (
2432
+ "resource:///modules/SiteSpecificBrowserIdUtils.jsm"
2433
+ ) ;
2439
2434
2440
- try {
2441
- window . setTimeout ( ( ) => {
2442
- SiteSpecificBrowserIdUtils . runSsbById ( id ) ;
2443
- Services . prefs . clearUserPref ( SsbPrefName ) ;
2444
- window . minimize ( ) ;
2445
- } , 2000 ) ;
2446
- } catch ( e ) {
2447
- console . error ( e ) ;
2448
- }
2435
+ try {
2436
+ window . setTimeout ( ( ) => {
2437
+ SiteSpecificBrowserIdUtils . runSsbById ( id ) ;
2438
+ Services . prefs . clearUserPref ( SsbPrefName ) ;
2439
+ window . minimize ( ) ;
2440
+ } , 2000 ) ;
2441
+ } catch ( e ) {
2442
+ console . error ( e ) ;
2449
2443
}
2450
2444
}
2451
2445
2452
-
2453
2446
/******************************************************************************************************************/
2454
2447
2455
2448
if ( ! uri || window . XULElement . isInstance ( uri ) ) {
0 commit comments