diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 93ded5a02..9b600b920 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -99,6 +99,7 @@ Main = # Fresh install else if !items.previousversion? + Main.isFirstRun = true Main.ready -> $.set 'previousversion', g.VERSION Settings.open() @@ -502,6 +503,16 @@ Main = new Notice 'error', 'Error: Multiple copies of 4chan X are enabled.' $.addClass doc, 'tainted' + # Detect conflicts with native extension + if g.SITE.testNativeExtension and not $.hasClass(doc, 'tainted') + {enabled} = g.SITE.testNativeExtension() + if enabled + $.addClass doc, 'tainted' + if Conf['Disable Native Extension'] and !Main.isFirstRun + msg = $.el 'div', + <%= html('Failed to disable the native extension. You may need to block it.') %> + new Notice 'error', msg + unless errors instanceof Array error = errors else if errors.length is 1 diff --git a/src/site/SW.yotsuba.coffee b/src/site/SW.yotsuba.coffee index 44521b85a..c29f51cfe 100644 --- a/src/site/SW.yotsuba.coffee +++ b/src/site/SW.yotsuba.coffee @@ -225,3 +225,7 @@ SW.yotsuba = isLinkified: (link) -> ImageHost.test(link.hostname) + + testNativeExtension: -> + $.global -> + @enabled = 'true' if window.Parser.postMenuIcon