aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/sitepatch-safari.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/sitepatch-safari.js')
-rw-r--r--src/js/sitepatch-safari.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/js/sitepatch-safari.js b/src/js/sitepatch-safari.js
index e4eee90..4c4e9f6 100644
--- a/src/js/sitepatch-safari.js
+++ b/src/js/sitepatch-safari.js
@@ -9,7 +9,7 @@ self.vAPI = self.vAPI || {};
if (/^www\.youtube(-nocookie)?\.com/.test(location.host)) {
vAPI.sitePatch = function() {
- window.addEventListener('load', function onWindowLoad() {
+ var onWindowLoad = function() {
this.removeEventListener('load', onWindowLoad, true);
var spf = this._spf_state;
@@ -19,7 +19,8 @@ if (/^www\.youtube(-nocookie)?\.com/.test(location.host)) {
window.location.href = url;
};
}
- }, true);
+ };
+ window.addEventListener('load', onWindowLoad, true);
// based on ExtendTube's ad removing solution