Disable error reports if localStorage is blocked.
This commit is contained in:
parent
ca7750bc9e
commit
abedf85973
@ -42,7 +42,7 @@ Main =
|
|||||||
# Track resolution of this bug.
|
# Track resolution of this bug.
|
||||||
Main.logError
|
Main.logError
|
||||||
message: 'Chrome Storage API bug'
|
message: 'Chrome Storage API bug'
|
||||||
error: new Error chrome.runtime.lastError.message or 'no lastError.message'
|
error: new Error '~'
|
||||||
<% } %>
|
<% } %>
|
||||||
Main.initFeatures()
|
Main.initFeatures()
|
||||||
|
|
||||||
@ -202,13 +202,14 @@ Main =
|
|||||||
Main.callbackNodes Post, posts
|
Main.callbackNodes Post, posts
|
||||||
|
|
||||||
if $.hasClass d.body, 'fourchan_x'
|
if $.hasClass d.body, 'fourchan_x'
|
||||||
Main.v2Detected = true
|
Main.disableReports = true
|
||||||
alert '4chan X v2 detected: Disable it or v3 will break.'
|
alert '4chan X v2 detected: Disable it or v3 will break.'
|
||||||
|
|
||||||
try
|
try
|
||||||
localStorage.getItem '4chan-settings'
|
localStorage.getItem '4chan-settings'
|
||||||
catch err
|
catch err
|
||||||
new Notice 'warning', 'Cookies need to be enabled on 4chan for <%= meta.name %> to properly function.', 30
|
new Notice 'warning', 'Cookies need to be enabled on 4chan for <%= meta.name %> to properly function.', 30
|
||||||
|
Main.disableReports = true
|
||||||
|
|
||||||
$.event '4chanXInitFinished'
|
$.event '4chanXInitFinished'
|
||||||
|
|
||||||
@ -284,7 +285,7 @@ Main =
|
|||||||
Main.errors.push data
|
Main.errors.push data
|
||||||
|
|
||||||
postErrors: ->
|
postErrors: ->
|
||||||
return if Main.v2Detected
|
return if Main.disableReports
|
||||||
errors = Main.errors.filter((d) -> !!d.error.stack).map((d) ->
|
errors = Main.errors.filter((d) -> !!d.error.stack).map((d) ->
|
||||||
<% if (type === 'userscript') { %>
|
<% if (type === 'userscript') { %>
|
||||||
# Before:
|
# Before:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user