From dff299ba2eaa9ac40c9406bd08bbc34ebdd1cf9d Mon Sep 17 00:00:00 2001 From: cilame Date: Sat, 23 Oct 2021 16:53:52 +0800 Subject: [PATCH] add --- background.js | 2 +- tools/error_front.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index f3f5d34..db2374c 100644 --- a/background.js +++ b/background.js @@ -42,7 +42,7 @@ chrome.debugger.onEvent.addListener(function (source, method, params){ if (params.resourceType == 'Document'){ var replbody = btoa(unescape(encodeURIComponent(html_script_replacer(respboby, replacer, params.request.url)))) } fillfunc(replbody) } catch(e){ - send_error_info_to_front(e.stack, currtab.tabId) + send_error_info_to_front(e.stack, currtab.tabId, params.request.url) fillfunc(result.body) } }) return } diff --git a/tools/error_front.js b/tools/error_front.js index 4bb6a13..05dc399 100644 --- a/tools/error_front.js +++ b/tools/error_front.js @@ -1,5 +1,5 @@ -function send_error_info_to_front(e, tid){ +function send_error_info_to_front(e, tid, url){ chrome.tabs.query({active: true, currentWindow: true}, function(tabs){ - chrome.tabs.sendMessage(tid, {action: {type:'error', info: e}}, function(response) {}); + chrome.tabs.sendMessage(tid, {action: {type:'error', info: url + '\n' + e}}, function(response) {}); }); } \ No newline at end of file