New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 892159 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Cannot launch custom URI from an extension without leaving an empty tab open

Reported by nicholas...@gmail.com, Oct 4

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Steps to reproduce the problem:
An extension cannot open a custom URI link without opening a blank tab.

I have created below an example that will create an extension that adds a context menu item to "launch the link with the custom URI" for all links on a page. 

On firefox, this works. It opens the custom action URI, then it prompts "Do you want to launch this in your CustomAppNameHere?" meanwhile the script closes the empty tab. But when it closes the empty tab the prompt stays.

In chrome/chromium, when the tab is closed, so is the dialog to launch the page in the custom app.

see comments on this question https://stackoverflow.com/questions/52639875/how-to-launch-a-custom-uri-from-an-extension-without-leaving-an-empty-tab-open?noredirect=1#comment92213224_52639875 for some other things we tried. 

function handleClick(info, tab) {
  chrome.tabs.create({
      url: "customuri:/" + info.linkUrl
    },
    function(newTab) {
      setTimeout(function() {
        chrome.tabs.remove(newTab.id);
     }, 250);
    }
  );
}

chrome.contextMenus.create({
  "title": "Open this link with a custom URI", 
  "contexts":["link"],
  "onclick": handleClick
});

Here is a pastebin of the same: https://pastebin.com/fuYFjSHN

What is the expected behavior?
It should open up the prompt to "Is it ok to open this link in CustomAppNameHere?" while also closing the empty tab that was used to get there.

What went wrong?
Leave an empty tab there, and all attempts to close that tab autmoatically failed.

Did this work before? No 

Chrome version: 69.0.3497.100  Channel: stable
OS Version: 10.0
Flash Version:
 
Labels: Needs-Triage-M69
Components: -Blink Platform>Extensions>API
Cc: krajshree@chromium.org
Labels: Triaged-ET Needs-Feedback
reporter@ - Thanks for filing the issue...!!

Could you please provide a sample test file/url to test the issue from our end as navigating to https://pastebin.com/fuYFjSHN show some code only and no test file.
A sample test file will help us in triaging the issue further.

Thanks...!!
Hi first of all here is the steps to create your own custom protocol URI in Windows: https://gist.github.com/aleksey-bykov/d7d2bc61adf2da519f6844db87e023fa

Here is the extension that demonstrates the problem

https://drive.google.com/file/d/1r7HEwRe9ZE3g5CjiUsCuM6yoiZv-gR7k


The extension adds a "link" context menu. So just find a link in any page, then right click it, then say "Open link in dev custom protocol uri"

it should reproduce the problem
Project Member

Comment 6 by sheriffbot@chromium.org, Oct 5

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: phanindra.mandapaka@chromium.org
Labels: Target-72 M-72 FoundIn-71 FoundIn-70 FoundIn-72 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
As per comment #4 and comment #5, Able to reproduce the issue on reported chrome version 69.0.3497.100 also on latest chrome 72.0.3610.0 using Mac 10.14.0, Ubuntu 17.10 and Windows 10.  
 
Same behavior is seen on M60(60.0.3112.113) hence considering it as non-regression and marking it as Untriaged.

Thanks! 

Sign in to add a comment