Explorar el Código

fix: visit web trigger not working in SPA

Ahmad Kholid hace 2 años
padre
commit
745fefbf59
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  1. 1 1
      src/background/BackgroundEventsListeners.js
  2. 2 2
      src/background/index.js

+ 1 - 1
src/background/BackgroundEventsListeners.js

@@ -15,7 +15,7 @@ class BackgroundEventsListeners {
     BackgroundWorkflowTriggers.scheduleWorkflow(event);
   }
 
-  static onWebNavigationCompleted({ tabId, url, frameId }) {
+  static onHistoryStateUpdated({ tabId, url, frameId }) {
     if (frameId > 0) return;
 
     BackgroundWorkflowTriggers.visitWebTriggers(tabId, url);

+ 2 - 2
src/background/index.js

@@ -21,8 +21,8 @@ browser.runtime.onInstalled.addListener(
   BackgroundEventsListeners.onRuntimeInstalled
 );
 
-browser.webNavigation.onCompleted.addListener(
-  BackgroundEventsListeners.onWebNavigationCompleted
+browser.webNavigation.onHistoryStateUpdated.addListener(
+  BackgroundEventsListeners.onHistoryStateUpdated
 );
 
 const contextMenu =