| Summary: | Web Inspector: Extension scripts with parse errors do not show up in Web Inspector | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||||
| Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
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.
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? Created attachment 367659 [details]
[PATCH] Proposed Fix
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`. Comment on attachment 367659 [details] [PATCH] Proposed Fix Clearing flags on attachment: 367659 Committed r244398: <https://trac.webkit.org/changeset/244398> All reviewed patches have been landed. Closing bug. |
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" } }