Detect conflicts with native extension and show appropriate error message. #1627
This commit is contained in:
parent
5f4ae3231f
commit
53f2252f38
@ -99,6 +99,7 @@ Main =
|
|||||||
|
|
||||||
# Fresh install
|
# Fresh install
|
||||||
else if !items.previousversion?
|
else if !items.previousversion?
|
||||||
|
Main.isFirstRun = true
|
||||||
Main.ready ->
|
Main.ready ->
|
||||||
$.set 'previousversion', g.VERSION
|
$.set 'previousversion', g.VERSION
|
||||||
Settings.open()
|
Settings.open()
|
||||||
@ -502,6 +503,16 @@ Main =
|
|||||||
new Notice 'error', 'Error: Multiple copies of 4chan X are enabled.'
|
new Notice 'error', 'Error: Multiple copies of 4chan X are enabled.'
|
||||||
$.addClass doc, 'tainted'
|
$.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 <a href="' + meta.faq + '#blocking-native-extension" target="_blank">block it</a>.') %>
|
||||||
|
new Notice 'error', msg
|
||||||
|
|
||||||
unless errors instanceof Array
|
unless errors instanceof Array
|
||||||
error = errors
|
error = errors
|
||||||
else if errors.length is 1
|
else if errors.length is 1
|
||||||
|
|||||||
@ -225,3 +225,7 @@ SW.yotsuba =
|
|||||||
|
|
||||||
isLinkified: (link) ->
|
isLinkified: (link) ->
|
||||||
ImageHost.test(link.hostname)
|
ImageHost.test(link.hostname)
|
||||||
|
|
||||||
|
testNativeExtension: ->
|
||||||
|
$.global ->
|
||||||
|
@enabled = 'true' if window.Parser.postMenuIcon
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user