-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setAsDefaultProtocolClient for protocol tel:// does not work at Windows 10 #14108
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
Additional information: Operating System:
|
As a workaround, anyone wanting to register the tel protocol can use this snippet: import {Registry} from 'rage-edit';
if(process.platform === 'win32') {
(async () => {
await Registry.set('HKCU\\Software\\Your app name\\Capabilities', 'ApplicationName', 'Your app name');
await Registry.set('HKCU\\Software\\Your app name\\Capabilities', 'ApplicationDescription', 'Your app name');
await Registry.set('HKCU\\Software\\Your app name\\Capabilities\\URLAssociations', 'tel', 'Your app name.tel');
await Registry.set('HKCU\\Software\\Classes\\Your app name.tel\\DefaultIcon', '', process.execPath);
await Registry.set('HKCU\\Software\\Classes\\Your app name.tel\\shell\\open\\command', '', `"${process.execPath}" "%1"`);
await Registry.set('HKCU\\Software\\RegisteredApplications', 'Your app name', 'Software\\Your app name\\Capabilities');
})();
} The registration is per user, so you need to execute this code for every user. You can execute it at every launch of your app, it won't do any harm. |
Hello! I found out a case when tel: protocol cannot be used on Windows 7. If there is no default application for tel: protocol, I can register my own application and it works perfect. But if there is another program already registered, my application isn't even displayed in the list of available applications. |
Thank you for taking the time to report this issue and helping to make Electron better. The version of Electron you reported this on has been superseded by newer releases. If you're still experiencing this issue in Electron v4.2.x or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know. I'm setting the Thanks in advance! Your help is appreciated. |
@sofianguy the issue for Windows 7 I described in the last comment is reproduced on 5.0.2. I guess issue for Windows 10 is reproduced on the same version. I'll check it today. |
The issue is reproduced with Electron 5.0.2 on Windows 10 |
@clusterberries Is there a solution for win7? |
As a workaround, anyone wanting to register the tel protocol in window 7 can use this snippet: import {Registry} from 'rage-edit';
|
@joeyer I tried to find solution for windows 7, I tried to set keys to HKLM, but it requires admin rights. My application doesn't have admin rights, so it is not an appropriate solution for me. |
Thank you for taking the time to report this issue and helping to make Electron better. The version of Electron you reported this on has been superseded by newer releases. If you're still experiencing this issue in Electron 6.x.y or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know. I'm setting the Thanks in advance! Your help is appreciated. |
Thank you for your issue! We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue. |
Hi, I'm using electron 15.0.0 with Windows 10. The method seems not work. I tried with "tel", "callto" and with a custom protocol but it works only with my custom protocol. The app is not registered for the protocol I specify, so when I call the url, the app won't be opened. Also app can't be registered as default app manually, so the problem is that the method doesn't register the app for handling protocol. My code is very simple:
Is there some log I can activate in order to investigate it? Should I manually write the keys into register? |
Found this when searching for a solution to #22565 - The best are workarounds which require admin privileges for your application (not even sure how well they work in windows 7,8,10 let alone 11). Do the Electron SDK devs anticipate this will ever be fixed? If so, do we have ETA please? |
This appears to still be an issue in that it's not possible to use Running ElectronJS v22.2.0 on a Windows 10 PC. I've also got local administrator rights, although the end user may not. |
Not making any sense. Setting default app for some type of document requires some admin privileges. How to could we make it possible from an user's app. |
Pretty sure the handler for the tel protocol doesn't require admin privileges to set in Windows in the same way as setting the default handler for a .doc file doesn't because it should be being set at a user level, not machine. The whole point (and this issue is closed btw) is that the setAsDefaultProtocolClient doesn't work |
This issue has been present for a while, I do not think it will be solved in a near future since Windows uses a hash to validate the protocol association (at least it has been reverse engineered, link). You can check the registry entry for the association here: To have a similar experience as const { Registry } = require('rage-edit');
await Registry.delete('HKCU\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\tel\\UserChoice'); 3 - Make the association modal appear with: const { shell } = require('electron');
shell.openExternal('tel:'); You can tweak the flow checking if your app is currently the protocol handler: const myAppName = 'your-app-name'
const protocol = 'tel'
const registryAppName = await Registry.get(
`HKCU\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\${protocol}\\UserChoice`,
'ProgId'
);
const associatedAppName = registryAppName.replace(`.${protocol}`, '');
const isMyAppAssociated = associatedAppName === myAppName Please do not forget to remove your entries from the Windows Registry when your app is being uninstalled. |
Expected Behavior
On calling url with protocol "tel://" electron application must appeare at dialog window with appropriate applications wich can handle tel protocol.
Actual behavior
On calling url with protocol "tel://" Electron application does not appeare at list of applications wich can handle tel protocol.
To Reproduce
app.setAsDefaultProtocolClient(Protocol);
at main.js;Additional Information
Possible solution will be change
SetAsDefaultProtocolClient
implementation at browser_win.cc: for Windows 10 must be set such registry keys:Also must be changed
IsDefaultProtocolClient
andRemoveAsDefaultProtocolClient
The text was updated successfully, but these errors were encountered: