chrome.tabs.update sometimes can't update a tab when using protocol for url like skype://, steam://... + link
Reported by
willalwa...@gmail.com,
Mar 4 2016
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36 Steps to reproduce the problem: 1. install an extension & a free media player (Potplayer) - https://potplayer.daum.net/ (check an association when you install the player so it could add its own protocol - potplayer://) example code in background.js: chrome.contextMenus.onClicked.addListener(function(info, tab) { if (info.menuItemId === "anyLinkOpen") chrome.tabs.update({ url: "potplayer://" + info.pageUrl}); ... 2. a) Open chrome://settings/ check "Continue where you left off" ("On startup" feature); Open for e.g. https://www.youtube.com/watch?v=aSVpBqOsC7o in some tab Using the extension open this video in Potplayer - right click and "Play current video.." (don't use buttons) see screenshot http://postimg.org/image/cnhzwdkbd/ It would open the video in the player normally Close the player and close the browser (do not close the tab) Start the browser again - you see you latest tab with youtube video Try to open this video in potplayer again using as you did the first time (from context menu) It won't work (nothing happens), it will work only in new tab that you create also: b) sometimes items from context menu doesn't do anything if you trying to use it on links in some Youtube iframes on such sites like feedly.com - see screenshot http://postimg.org/image/kbqw3mp1l/ What is the expected behavior? Chrome should just open Potplayer in your system and play the video in it, but nothing happens What went wrong? it could not run protocol + info.linkUrl (during tab update), but if you remove the protocol so it would look like "chrome.tabs.update({ url: info.linkUrl });" then it will update tab normally in any case - simple links are updating normally (of course when we talk about updating tab with given protocol+link it don't actually update url bar to this address in active browser tab, but just run external program) So sometimes browser can't correctly open url that contains some protocol WebStore page: https://chrome.google.com/webstore/detail/potplayer-youtube-shortcu/cfdpeaefecdlkdlgdpjjllmhlnckcodp Did this work before? N/A Chrome version: 49.0.2623.75 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 20.0 r0
,
Apr 6 2016
,
Apr 6 2016
Please have a look at the repro in #1
,
Apr 6 2016
,
May 1 2016
,
May 3 2016
,
May 3 2016
update: now don't test it using steps from my first message. Because the extension was updated - and there is an alternative way to use protocol (it doesn't use chrome.tabs.update anymore for this purpose) test only based on https://bugs.chromium.org/p/chromium/issues/detail?id=591985#c1
,
Aug 26 2016
From the code in comment #1, it looks like the call to chrome.tabs.update is missing a tab id as its first argument. To the original reporter: can you see if that indeed was the problem? If not, please report back here and we can reopen.
,
Aug 27 2016
You're so confident that it doesn't work right because it misses id and even changed Status to WontFix. Are you even tried my example? If id really was a problem then it didn't work at all! It works, but buggy. Anyway I remember I tried using id of tab (current/active) and it still worked buggy. P.s. for Firefox this code works without any problem. p.s. why this site doesn't have option to edit post?
,
Aug 27 2016
Here an example that call update with id of current tab:
chrome.contextMenus.onClicked.addListener(function(info) {
if (info.menuItemId === "SkypeTestRunUsingContextMenu") {
chrome.tabs.query({currentWindow: true, active: true},
function(tabs){
chrome.tabs.update(tabs[0].id, { url: "skype://"});
}
);
}
});
Everything the same. Anyway if I don't set tab id then it will be the current tab by default (I guess you should knew about it)
,
Aug 27 2016
https://developer.chrome.com/extensions/tabs#method-update - here you can see that tab id is optional (Defaults to the selected tab of the current window)
,
Aug 29 2016
Sorry, I was looking at the fact that you were calling tabs.update from the background page, and thinking (incorrectly it turns out) that leaving out the tab id would try and navigate the background page itself which isn't allowed. But you're right, leaving out the tab id just causes the attempted navigation to apply to whichever tab happens to be focused.
,
Aug 30 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 15 2018
,
Jun 8 2018
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by willalwa...@gmail.com
, Mar 5 2016I don't know if someone was trying to test the problem, so here another easy steps to reproduce the problem if you have for e.g. Skype Desktop installed: 1) chrome://settings/, check "Continue where you left off" ("On startup" feature). 2) ------index.html:------- create and open html page in Chrome [or just unzip it from attached archive and open] <html> <body> <a href="#">link</a> </body> </html> 3) I've attached an extension. It contains only two files: [you can replace skype:// with any other application - steam, mailto...] -------manifest.json:------- { "background": { "scripts": [ "background.js" ], "persistent": false }, "manifest_version": 2, "name": "SkypeTestRunUsingContextMenu", "permissions": [ "<all_urls>", "contextMenus", "tabs" ], "version": "1" } -------background.js------- chrome.contextMenus.onClicked.addListener(function(info) { if (info.menuItemId === "SkypeItem") chrome.tabs.update({ url: "skype://"}); }); var skypetest; if (skypetest !== "SkypeItem") { skypetest = chrome.contextMenus.create({ title: "Start Skype", id: 'SkypeItem', contexts: ["link"] }); } 4) right click on a "link" from tab "index.html" & choose "Start Skype" - it should run Skype application normally 5) close Chrome but do not close your tab with opened "index.html" 6) start Chrome and again right click on a "link", "Start Skype" - it will not run/start Skype... (bug)1.6 KB
1.6 KB Download