mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -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...) ->
|
||||
console.error(args...)
|
||||
content = args.map(Log.str.bind(Log)).join(' ')
|
||||
localStorage['logLastError'] = content
|
||||
localStorage['log'] += 'ERROR: ' + content + '\n'
|
||||
|
||||
unhandledPromises = []
|
||||
|
@ -1,6 +1,8 @@
|
||||
window.OmegaTargetWebBasics =
|
||||
getLog: (callback) ->
|
||||
callback(localStorage['log'] || '')
|
||||
getError: (callback) ->
|
||||
callback(localStorage['logLastError'] || '')
|
||||
getEnv: (callback) ->
|
||||
extensionVersion = chrome.runtime.getManifest().version
|
||||
callback({
|
||||
|
@ -1,2 +1,3 @@
|
||||
window.UglifyJS_NoUnsafeEval = true
|
||||
localStorage['log'] = ''
|
||||
localStorage['logLastError'] = ''
|
||||
|
@ -15,4 +15,10 @@ window.OmegaTargetWebBasics.getEnv (env) ->
|
||||
SwitchyOmega #{env.projectVersion}
|
||||
#{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