mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 23:08:13 -05:00
Attach last error message when using the Report Issue link.
This commit is contained in:
parent
4fa13c686d
commit
b3fada8fac
@ -10,6 +10,7 @@ Log.log = (args...) ->
|
|||||||
Log.error = (args...) ->
|
Log.error = (args...) ->
|
||||||
console.error(args...)
|
console.error(args...)
|
||||||
content = args.map(Log.str.bind(Log)).join(' ')
|
content = args.map(Log.str.bind(Log)).join(' ')
|
||||||
|
localStorage['logLastError'] = content
|
||||||
localStorage['log'] += 'ERROR: ' + content + '\n'
|
localStorage['log'] += 'ERROR: ' + content + '\n'
|
||||||
|
|
||||||
unhandledPromises = []
|
unhandledPromises = []
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
window.OmegaTargetWebBasics =
|
window.OmegaTargetWebBasics =
|
||||||
getLog: (callback) ->
|
getLog: (callback) ->
|
||||||
callback(localStorage['log'] || '')
|
callback(localStorage['log'] || '')
|
||||||
|
getError: (callback) ->
|
||||||
|
callback(localStorage['logLastError'] || '')
|
||||||
getEnv: (callback) ->
|
getEnv: (callback) ->
|
||||||
extensionVersion = chrome.runtime.getManifest().version
|
extensionVersion = chrome.runtime.getManifest().version
|
||||||
callback({
|
callback({
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
window.UglifyJS_NoUnsafeEval = true
|
window.UglifyJS_NoUnsafeEval = true
|
||||||
localStorage['log'] = ''
|
localStorage['log'] = ''
|
||||||
|
localStorage['logLastError'] = ''
|
||||||
|
@ -15,4 +15,10 @@ window.OmegaTargetWebBasics.getEnv (env) ->
|
|||||||
SwitchyOmega #{env.projectVersion}
|
SwitchyOmega #{env.projectVersion}
|
||||||
#{env.userAgent}
|
#{env.userAgent}
|
||||||
"""
|
"""
|
||||||
document.querySelector('.report-issue').href = url + encodeURIComponent(body)
|
link = document.querySelector('.report-issue')
|
||||||
|
link.href = url + encodeURIComponent(body)
|
||||||
|
window.OmegaTargetWebBasics.getError (err) ->
|
||||||
|
return unless err
|
||||||
|
body += "\n```\n#{err}\n```"
|
||||||
|
final_url = url + encodeURIComponent(body)
|
||||||
|
link.href = final_url.substr(0, 2000) # Limit URL up to 2000 chars.
|
||||||
|
Loading…
Reference in New Issue
Block a user