Opened 9 months ago

Closed 3 months ago

#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

  1. Serve document below.
  2. Add filter.
  3. 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.

Change History (8)

comment:1 follow-up: Changed 9 months ago by sebastian

Is that related as well to ticket:7409#comment:8?

comment:2 Changed 9 months ago 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 9 months ago 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: Changed 8 months ago by Ross

#$#log works but #$#trace does not in Edge.

ABP 0.9.14.2284
Edge 44.17763.1.0

comment:5 Changed 8 months ago by mjethani

  • Description modified (diff)

comment:6 in reply to: ↑ 4 Changed 8 months ago 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 6 months ago 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 3 months ago 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.

Note: See TracTickets for help on using tickets.