From e44df3d08b9afcc61f8a59a3020643ce03353d06 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 5 Jun 2016 00:38:59 -0700 Subject: [PATCH] Accessing window.frameElement.src from non-same-origin window may cause an error. Fixes regression from 59bac43afb725c0960d6a40c6847489f3c09a43c. --- src/main/Main.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 957a4f54b..8eef3ff38 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -3,9 +3,6 @@ Main = # XXX Work around Pale Moon / old Firefox + GM 1.15 bug where script runs in iframe with wrong window.location. return if d.body and not $ 'title', d.head - # Don't run inside ad iframes. - return if window.frameElement and window.frameElement.src is '' - # XXX dwb userscripts extension reloads scripts run at document-start when replaceState/pushState is called. return if window['<%= meta.name %> antidup'] window['<%= meta.name %> antidup'] = true @@ -16,6 +13,9 @@ Main = $.ready -> Captcha.fixes.init() return + # Don't run inside ad iframes. + return if window.frameElement and window.frameElement.src is '' + # Detect multiple copies of 4chan X $.on d, '4chanXInitFinished', -> if Main.expectInitFinished