Firefox 122.0. Extensions. "chrome.scripting.executeScript" removes ":" (colon) from url when using in double with protocol url in
Categories
(Core :: Networking, defect)
Tracking
()
People
(Reporter: willalwaysdie, Unassigned)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
|
17.31 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Steps to reproduce:
The following code for Firefox extensions (addons) was working fine on Firefox until 122.0 version:
background.js:
function openUrl(url) {
window.open(url, '_self');
}
function play(url) {
chrome.tabs.query( {currentWindow: true, active : true}, function(tabs) {
let urlFinaly = "potplayer://" + url;
if (devMode) console.log(urlFinaly);
chrome.scripting.executeScript({target: {tabId: tabs[0].id}, func: openUrl, args: [urlFinaly]});
});
}
in Firefox Console it prints:
potplayer://https://www.youtube.com/watch?v=Qo_cAmJMPx4
but in PotPlayer (a external video player for Windows) I get https// instead of https://:
(see attached screenshot)
For Firefox 121.* and earlier it works fine, and also it works fine for newest Google Chrome browser - the link can be successfully passed correctly to PotPlayer
How can I fix it for new version of Firefox?
Actual results:
in PotPlayer (a external video player for Windows) I get "https//" instead of "https://"
Expected results:
in PotPlayer (a external video player for Windows) I should get "https://"
Comment 1•2 years ago
|
||
Can you use mozregression to get a regression range?
fixed temporary by let urlFinaly = "potplayer://" + url.replace("://", "/://");
Updated•2 years ago
|
Comment 4•2 years ago
|
||
new URL("potplayer://https://www.youtube.com").href now produces potplayer://https//www.youtube.com, which is correct according to https://jsdom.github.io/whatwg-url.
(In reply to Tom Schuster (MoCo) from comment #4)
new URL("potplayer://https://www.youtube.com").hrefnow producespotplayer://https//www.youtube.com, which is correct according to https://jsdom.github.io/whatwg-url.
What does it mean exactly? How can extensions developer pass a normal link from Firefox to external programs installed on windows or Linux?
Comment 6•2 years ago
|
||
The URL you are constructing is semantically incorrect. I don't know what kind URLs "potplayer" accepts, but maybe using potplayer://www.youtube.com/watch?v=Qo_cAmJMPx4 would work instead?
Comment 7•2 years ago
|
||
:edgul, since you are the author of the regressor, bug 1603699, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Comment 8•2 years ago
|
||
(In reply to Anonym from comment #0)
function play(url) { chrome.tabs.query( {currentWindow: true, active : true}, function(tabs) { let urlFinaly = "potplayer://" + url; if (devMode) console.log(urlFinaly); chrome.scripting.executeScript({target: {tabId: tabs[0].id}, func: openUrl, args: [urlFinaly]}); }); }
Could you change the code to be:
let urlFinaly = "potplayer:" + url; instead?
That should create a URL that looks like potplayer:https://www.youtube.com/watch?v=Qo_cAmJMPx4 and should work to pass the URL to an external program.
(In reply to Valentin Gosu [:valentin] (he/him) from comment #8)
(In reply to Anonym from comment #0)
function play(url) { chrome.tabs.query( {currentWindow: true, active : true}, function(tabs) { let urlFinaly = "potplayer://" + url; if (devMode) console.log(urlFinaly); chrome.scripting.executeScript({target: {tabId: tabs[0].id}, func: openUrl, args: [urlFinaly]}); }); }Could you change the code to be:
let urlFinaly = "potplayer:" + url;instead?That should create a URL that looks like
potplayer:https://www.youtube.com/watch?v=Qo_cAmJMPx4and should work to pass the URL to an external program.
thanks! it works :)
Comment 10•2 years ago
|
||
Thanks!
Description
•