New issue
Advanced search Search tips

Issue 773468 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 749492
Owner: ----
Closed: Oct 2017
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Anchor targeting does not work right with javascript: URLs

Reported by bzbar...@mit.edu, Oct 10 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:58.0) Gecko/20100101 Firefox/58.0

Steps to reproduce the problem:
1. Load the testcase.
2. Click the link.

What is the expected behavior?
The text "THIS SHOULD BE IN THE SUBFRAME" appears in the subframe.

What went wrong?
The text overwrote the whole page.

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 63.0.3230.0 (Official Build) dev (64-bit)  Channel: n/a
OS Version: OS X 10.12
Flash Version: Shockwave Flash 26.0 r0

The HTML spec is pretty clear on this: the target is used to find the right browsing context before any script gets run, and then it runs in the current window in the target browsing context.

This also means that something like this:

<a href="javascript:'THIS SHOULD BE IN THE NEW WINDOW'" target="_blank">Click me</a>

Should open a new window and run the script in that new window.  In Chrome that doesn't happen.
 
baz.html
131 bytes View Download

Comment 1 by bzbar...@mit.edu, Oct 10 2017

Note that this is causing interop issues.  We ran into this because https://uptownbigband.ch/ assumed the spec-violating behavior Chrome has and didn't bother to test in other browsers.
Labels: Needs-Triage-M63 Needs-Bisect
Mergedinto: 749492
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment