Browse Source

fix: visit web trigger not working in SPA

Ahmad Kholid 2 years ago
parent
commit
745fefbf59
2 changed files with 3 additions and 3 deletions
  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 =