Просмотр исходного кода

fix: getRules in old Chrome wants 2 args

tophf 3 лет назад
Родитель
Сommit
2e78544b45
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/background/index.js

+ 1 - 1
src/background/index.js

@@ -133,7 +133,7 @@ initialize(() => {
   const api = global.chrome.declarativeContent;
   if (api) {
     // Using declarativeContent to run content scripts earlier than document_start
-    api.onPageChanged.getRules(async ([rule]) => {
+    api.onPageChanged.getRules(/* for old Chrome */ null, async ([rule]) => {
       const id = rule?.id;
       const newId = process.env.INIT_FUNC_NAME;
       if (id === newId) {