breaking booklets after '#' in javascript
Categories
(Core :: Networking, defect, P3)
Tracking
()
People
(Reporter: axet, Assigned: valentin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Steps to reproduce:
Hello! Seems like firefox breaking javascript bookmark if script contains '#' it start to encode javascript spaces with %20.
Try add following javascript as bookmark, and open again. Javascript will be broken.
Actual results:
javascript: (function() {
var e = document.querySelector('paper-dialog #button');
if (e != null && e.offsetParent != null) {
e.click();
console.log('click dialog');
}
})();
javascript: (function() { var e = document.querySelector('paper-dialog #button');%20%20%20%20%20%20%20%20%20if%20(e%20!=%20null%20&&%20e.offsetParent%20!=%20null)%20{%20%20%20%20%20%20%20%20%20%20%20%20%20e.click();%20%20%20%20%20%20%20%20%20%20%20%20%20console.log('click%20dialog');%20%20%20%20%20%20%20%20%20}%20})();
Updated•6 years ago
|
Comment 1•6 years ago
|
||
One workaround is to replace the #
by %23
(the encoded value for the hash). Otherwise the URL parser thinks that the # is the anchor for the URL.
It does seem that we have different behaviour from Google Chrome, so moving this to Core, as I think it is likely the parser or encoder that is at issue.
Comment 2•6 years ago
|
||
Valentin, could you take a look at this?.
Thanks
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
According to the reference parser we're doing the right thing here.
Description
•