RESOLVED FIXED 196996
Web Inspector: Extension scripts with parse errors do not show up in Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=196996
Summary Web Inspector: Extension scripts with parse errors do not show up in Web Insp...
Joseph Pecoraro
Reported 2019-04-16 18:05:11 PDT
Extension scripts with parse errors do not show up in Web Inspector Steps to Reproduce: 1. Create a Safari extension with a script with a syntax error 2. Load a page where the content script loads => Syntax Error in console but no location and no resource content to link to Notes: • There is a Debugger message we ignore, such as: { "method": "Debugger.scriptFailedToParse", "params": { "url": "safari-extension://com.apple.Safari.Test.../script.js", "scriptSource":"…", "startLine": 1, "errorLine": 27, "errorMessage": "Unexpected end of script" } }
Attachments
[PATCH] Proposed Fix (2.44 KB, patch)
2019-04-16 18:09 PDT, Joseph Pecoraro
hi: review-
[PATCH] Proposed Fix (3.63 KB, patch)
2019-04-17 11:51 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2019-04-16 18:05:21 PDT
Joseph Pecoraro
Comment 2 2019-04-16 18:09:21 PDT
Created attachment 367597 [details] [PATCH] Proposed Fix For now this is useful for extension which I don't know how to test... The only thing this might eventually be useful for would be anonymous evals: setTimeout(() => { eval("console.log(1) }}}"); }); Which after the above still won't have a URL so the later parse error won't handle this. --- We could create a console message error here if `url` is null and ignore the `Console.messageAdded` in that case. This seems pretty edge casey at the moment.
Devin Rousso
Comment 3 2019-04-17 11:50:53 PDT
Comment on attachment 367597 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=367597&action=review r-, missing ChangeLog :( > Source/WebInspectorUI/UserInterface/Models/Script.js:-32 > - console.assert(id); Why was this removed?
Joseph Pecoraro
Comment 4 2019-04-17 11:51:21 PDT
Created attachment 367659 [details] [PATCH] Proposed Fix
Devin Rousso
Comment 5 2019-04-17 11:52:23 PDT
Comment on attachment 367659 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=367659&action=review rs=me > Source/WebInspectorUI/ChangeLog:20 > + Local scripts provide a null id and id is not required below. Along these lines, I'd remove the `|| null` from `this._range = range || null;` since it's asserted that it's a `WI.TextRange`.
WebKit Commit Bot
Comment 6 2019-04-17 12:59:30 PDT
Comment on attachment 367659 [details] [PATCH] Proposed Fix Clearing flags on attachment: 367659 Committed r244398: <https://trac.webkit.org/changeset/244398>
WebKit Commit Bot
Comment 7 2019-04-17 12:59:31 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.