Skip to content

Commit

Permalink
Merge pull request #421 from bvschaik/master
Browse files Browse the repository at this point in the history
Prevent window.onload from being run twice, Fixed #420
  • Loading branch information
maxxcrawford committed May 30, 2019
2 parents 4e96e78 + 9d0970f commit 847b447
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,7 @@ async function CheckIfURLShouldBeBlocked() {

// Cross-browser implementation of element.addEventListener()
function addPassiveWindowOnloadListener() {
const activeOnloadFunction = window.onload;
window.addEventListener("load", function() {
// window.onload = function () {
if (typeof activeOnloadFunction === "function") {
activeOnloadFunction();
}
CheckIfURLShouldBeBlocked();
}, false);
}
Expand Down

0 comments on commit 847b447

Please sign in to comment.