Bug 1547882 Comment 11 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I contacted the reporter and I think I finally figured out what the problem is.

STR:
Install https://addons.mozilla.org/en-US/firefox/addon/holddingtab/
Either drag a bookmark into the URL bar, or drag one of the top sites from the about:newtab page into the URL bar.
The extension will take you to something that looks like: moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?t=news.ycombinator.com&i=icons/holding.png&u=https%3A//news.ycombinator.com/
You'll notice that the u= has unescaped slashes

This can be more easily reproduced as:
```js
var url = new URL("moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?u=https%3A%2F%2Fnews.ycombinator.com%2F");
console.log(url.href); // moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?u=https%3A//news.ycombinator.com/

// but you can do this:
url.search="u=https%3A%2F%2Fnews.ycombinator.com%2F";
console.log(url.href); // moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?u=https%3A%2F%2Fnews.ycombinator.com%2F
```

Which means this is a bug when parsing `nsSimpleURI::SetSpecInternal`
I contacted the reporter and I think I finally figured out what the problem is.

STR:
Install https://addons.mozilla.org/en-US/firefox/addon/holddingtab/
Either drag a bookmark into the URL bar, or drag one of the top sites from the about:newtab page into the URL bar.
The extension will take you to something that looks like: moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?t=news.ycombinator.com&i=icons/holding.png&u=https%3A//news.ycombinator.com/
You'll notice that the u= has unescaped slashes

This can be more easily reproduced as:
```js
var url = new URL("moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?u=https%3A%2F%2Fnews.ycombinator.com%2F");
console.log(url.href); // moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?u=https%3A//news.ycombinator.com/

// but you can do this:
url.search="u=https%3A%2F%2Fnews.ycombinator.com%2F";
console.log(url.href); // moz-extension://a7d1572e-3beb-4d93-a920-c408fa09e8ea/_source/holding.html?u=https%3A%2F%2Fnews.ycombinator.com%2F
```

Back to Bug 1547882 Comment 11