Skip to content

Commit

Permalink
Use onResponeStarted for executing userscripts
Browse files Browse the repository at this point in the history
Potential solution for greasemonkey#2574
  • Loading branch information
Sxderp committed Nov 12, 2017
1 parent 6141b3d commit 8c47ef0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -65,6 +65,6 @@
"storage",
"tabs",
"unlimitedStorage",
"webNavigation"
"webRequest"
]
}
2 changes: 1 addition & 1 deletion src/bg/execute.js
Expand Up @@ -5,7 +5,7 @@ content script executions.
TODO: Make document_start execution time work as intended.
*/

function executeUserscriptOnNavigation(detail) {
function executeUserscriptOnResponseStarted(detail) {
if (false === getGlobalEnabled()) return;

var userScriptIterator = UserScriptRegistry.scriptsToRunAt(detail.url);
Expand Down
4 changes: 3 additions & 1 deletion src/bg/execute.run.js
@@ -1 +1,3 @@
chrome.webNavigation.onCommitted.addListener(executeUserscriptOnNavigation);
chrome.webRequest.onResponseStarted.addListener(
executeUserscriptOnResponseStarted,
{ 'urls': ['<all_urls>'], 'types': ['main_frame', 'sub_frame'] });

0 comments on commit 8c47ef0

Please sign in to comment.