فهرست منبع

refactor: revert unused changes in 4b22b03a

tophf 5 روز پیش
والد
کامیت
ccdd283656
2فایلهای تغییر یافته به همراه5 افزوده شده و 6 حذف شده
  1. 3 4
      src/background/utils/preinject.js
  2. 2 2
      src/types.d.ts

+ 3 - 4
src/background/utils/preinject.js

@@ -572,7 +572,7 @@ function prepareScript(script, env) {
 
 function triageRealms(scripts, forceContent, tabId, frameId, bag) {
   let code;
-  let wantsPage = 0;
+  let wantsPage;
   const toContent = [];
   for (const scr of scripts) {
     const metaStr = scr[META_STR];
@@ -586,13 +586,12 @@ function triageRealms(scripts, forceContent, tabId, frameId, bag) {
     } else {
       metaStr[0] = '';
       code = forceContent ? ID_BAD_REALM : scr[__CODE];
-      if (!forceContent) wantsPage = 1;
+      if (!forceContent) wantsPage = true;
     }
     scr.code = code;
   }
   if (bag) {
-    bag[INJECT][PAGE] = wantsPage
-      + ((!wantsPage || IS_FIREFOX) && triagePageRealm(bag[MORE]) ? 2 : 0);
+    bag[INJECT][PAGE] = wantsPage || triagePageRealm(bag[MORE]);
   }
   if (toContent[0]) {
     // Processing known feedback without waiting for InjectionFeedback message.

+ 2 - 2
src/types.d.ts

@@ -278,8 +278,8 @@ declare interface VMInjection extends VMInjectionDisabled, VMInjectionFlags {
   /** cache key for envDelayed, which also tells content bridge to expect envDelayed */
   more: string;
   nonce?: string;
-  /** `page` mode will be necessary, bit 0: at start/body, bit 1: at end/idle */
-  page: number;
+  /** `page` mode will be necessary */
+  page: boolean;
   scripts: VMInjection.Script[];
   sessionId: string;
 }