Opened on 03/28/2019 at 04:08:17 PM
Closed on 08/29/2019 at 05:43:52 PM
#7420 closed defect (rejected)
abort-current-inline-script snippet does not work in Edge
Reported by: | Ross | Assignee: | |
---|---|---|---|
Priority: | P4 | Milestone: | |
Module: | Core | Keywords: | closed-in-favor-of-gitlab |
Cc: | sebastian, kzar, mjethani, geo | Blocked By: | |
Blocking: | Platform: | Edge | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mjethani)
Environment
ABP 0.9.14.2284
Edge 44.17763.1.0
How to reproduce
- Serve document below.
- Add filter.
- Refresh page.
Example
Document:
<!DOCTYPE html> <html> <body> <p id="target">Not run yet.</p> <script> let target = document.getElementById("target"); target.innerHTML = "Script was aborted"; document.querySelector("#foo"); target.innerHTML = "Script was not aborted"; </script> </body> </html>
Filter:
<host>#$#abort-current-inline-script document.querySelector
Observed behaviour
The filter has no effect.
Expected behaviour
The snippet to cause the script to abort, as it does in Chrome/Firefox.
Notes
Before investigating this issue, bear in mind that abort-current-inline-script does not work in general (#7421, #7422). If there is a specific issue here that may also apply to other snippets, a better way would be to try a different snippet.
It seems log works but trace does not work on Edge; perhaps this is not about abort-current-inline-script then.
Attachments (0)
Change History (8)
comment:2 Changed on 03/29/2019 at 06:46:32 AM by mjethani
- Summary changed from abort-current-inline snippet does not work in Edge to abort-current-inline-script snippet does not work in Edge
comment:3 in reply to: ↑ 1 Changed on 03/29/2019 at 06:50:33 AM by mjethani
Replying to sebastian:
Is that related as well to ticket:7409#comment:8?
The easy way to find out, Ross, would be to use the filter #$#trace Hello. If it does not print, it is the same issue and applies to all "type 2" snippets (snippets which use a <script> element).
comment:4 follow-up: ↓ 6 Changed on 04/01/2019 at 04:59:24 PM by Ross
#$#log works but #$#trace does not in Edge.
ABP 0.9.14.2284
Edge 44.17763.1.0
comment:6 in reply to: ↑ 4 Changed on 04/02/2019 at 06:34:16 AM by mjethani
Replying to Ross:
#$#log works but #$#trace does not in Edge.
I have added a Notes section based on this. It may not be about abort-current-inline-script after all but rather about <script> tag injection. I would look into log and trace instead.
comment:7 Changed on 05/29/2019 at 12:21:48 PM by geo
I couldn't get past the timing issue, so I wasn't 100% sure that the <script> tag injection was sufficient.
I've tried different examples from tickets that mention this snippet, but every time the snippet would be the last to execute.
In the end, I've came up with this:
<!DOCTYPE html> <body> <script> setTimeout(()=> { let script = document.createElement("script"); script.textContent= `console.trace();` document.body.appendChild(script); },0); </script> </body>
Using this setup, log, trace, querySelector and the use case from #7373 work as expected.
comment:8 Changed on 08/29/2019 at 05:43:52 PM by sebastian
- Keywords closed-in-favor-of-gitlab added
- Resolution set to rejected
- Status changed from new to closed
Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.
Is that related as well to ticket:7409#comment:8?