oikonomopo / electron-deep-linking-mac-win Goto Github PK
View Code? Open in Web Editor NEWMinimal electron project with deep linking capabilities in macOS/win32 platforms (Single Instance Application)
License: GNU General Public License v3.0
Minimal electron project with deep linking capabilities in macOS/win32 platforms (Single Instance Application)
License: GNU General Public License v3.0
Hi! there is any plans to do it compatible with debian? or is not possible?
Thanks!
What about deep linking on Linux?
The method requestSingleInstanceLock
is always returns false
for Mac App Store builds (signed build). So application closes immediately after start.
More details: electron/electron#15958
First of all thank you for this awesome repo!
I found a bug when you try to open the app when it's already open:
Uncaught Exception:
ReferenceError: win is not defined at Function.app.makeSingleInstance
There is a way to fix it, to say that the app is already open or focus in the opened app ?
This is not an issue I am just trying to figure out if its possible to open it from google chrome and IE?
It would be better if we had linux support on same git repository.
I've faced with unnecessary parameters passed to handler together with deep link:
'--allow-file-access-from-files',
'--original-process-start-time=13234384064407895',
I think we should use only last element from the array: https://github.com/oikonomopo/electron-deep-linking-mac-win/blob/master/main.js#L63
electron-deep-linking-mac-win/main.js
Line 15 in e8ff064
Cloned your repo and created a dist.
I am able to launch the app from safari & firebox by typing myapp://param
in the url
But when I type the same url in "Chrome", the app is not being launched.
Does this even work in chrome?
Not working on Windows, but on MacOS all ok.
When I'm trying launch app through the deeplink from browser getting error "App launch error".
Why?
How to do it same thing on win-64
Hello and thank you for putting this great app together.
Sorry in advance for the newbie question, I am able to launch the app from the browsers, which is great however I am unsure of how to access the the query params on my index.html page. Can you help me with this?
Executing the protocol from Chrome works, but only once. If I wanted to loop over the protocol, the protocol fires once, but never again. It's odd because I am able to do this in all other browsers.
Here is an example:
<iframe id="dataDiv" style="width:100%;align:center;overflow-y:hidden;" frameborder="0" scrolling="no" />
url = "custom-protocol://some-data?"
for (i = 0; i < 5; i++) {
$("#dataDiv").attr("src", url + i);
}
This should execute a function based on the data 5 times in my electron app. It works perfectly in other browsers, just not chrome.
I also made a stack overflow for more detailed description about this issue:
https://stackoverflow.com/questions/55735666/looping-over-custom-protocol-with-chrome
Deep linking opens the default electron app on macOS and not the compiled app
With electron 9,
on mac, when the app is starting the link is not passed to the app
only when the app is already open the "open-url" event captures the protocol
wonder if you have a solution
thanks
When packaged on MacOS, the user can see the dot files after opening the dmg window. Can this be avoided?
// Deprecated
app.makeSingleInstance((argv, cwd) => {
/* ... */
})
// Replace with
app.requestSingleInstanceLock()
app.on('second-instance', (event, argv, cwd) => {
/* ... */
})
https://github.com/electron/electron/blob/master/docs/api/breaking-changes.md#appmakesingleinstance
Deep link only works if the mainWindows is opened.
My application hide's in tray when the close button is clicked, but then it stops listening to deep links
My hide code is this.
mainWindow.on('minimize', function (event) {
event.preventDefault();
mainWindow.hide();
});
mainWindow.on('close', function (event) {
if (!app.isQuiting) {
event.preventDefault();
mainWindow.hide();
}
return false;
});
tray = new Tray(icon16Path);
const contextMenu = Menu.buildFromTemplate([
{ label: 'Configurações', click: function(){
mainWindow.show();
} },
{ label: 'Fechar', click: function(){
app.isQuiting = true;
app.quit();
} }
]);
tray.setContextMenu(contextMenu);
@Ketans-MacBook-Pro custom % npm run dist
[email protected] dist /Applications/XAMPP/xamppfiles/htdocs/custom
build
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
• electron-builder version=20.40.2
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist/builder-effective-config.yaml
• no native production dependencies
• packaging platform=darwin arch=x64 electron=5.0.1 appOutDir=dist/mac
• default Electron icon is used reason=application icon is not set
• skipped macOS application code signing reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
0 identities found
Valid identities only
0 valid identities found
• building target=macOS zip arch=x64 file=dist/electron-deeplinking-macos-win32-0.0.1-mac.zip
• building target=DMG arch=x64 file=dist/electron-deeplinking-macos-win32-0.0.1.dmg
• building embedded block map file=dist/electron-deeplinking-macos-win32-0.0.1-mac.zip
Error: Exit code: 2. Command failed: /usr/bin/perl /private/var/folders/f_/yhbfz7pn3c1bzrcw_g1r25j40000gn/T/t-wMifIL/1-dmgProperties.pl
Can't locate Mac/Memory.pm in @inc (you may need to install the Mac::Memory module) (@inc contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /private/var/folders/f_/yhbfz7pn3c1bzrcw_g1r25j40000gn/T/t-wMifIL/1-dmgProperties.pl line 4.
BEGIN failed--compilation aborted at /private/var/folders/f_/yhbfz7pn3c1bzrcw_g1r25j40000gn/T/t-wMifIL/1-dmgProperties.pl line 4.
Can't locate Mac/Memory.pm in @inc (you may need to install the Mac::Memory module) (@inc contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /private/var/folders/f_/yhbfz7pn3c1bzrcw_g1r25j40000gn/T/t-wMifIL/1-dmgProperties.pl line 4.
BEGIN failed--compilation aborted at /private/var/folders/f_/yhbfz7pn3c1bzrcw_g1r25j40000gn/T/t-wMifIL/1-dmgProperties.pl line 4.
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/builder-util/src/util.ts:126:16
at ChildProcess.exithandler (child_process.js:315:5)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1047:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
From previous event:
at _applyProperties (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/out/dmgUtil.js:179:27)
at applyProperties (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/out/dmgUtil.js:166:27)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/src/dmg.ts:305:9
From previous event:
at _customizeDmg (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/out/dmg.js:455:24)
at customizeDmg (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/out/dmg.js:399:24)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/src/dmg.ts:48:54
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/src/dmgUtil.ts:37:31
From previous event:
at _attachAndExecute (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/out/dmgUtil.js:120:28)
at attachAndExecute (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/out/dmgUtil.js:97:28)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/src/dmg.ts:48:16
at Generator.next ()
From previous event:
at DmgTarget.build (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/dmg-builder/src/dmg.ts:21:42)
at Function.buildAsyncTargets (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/platformPackager.ts:140:36)
at MacPackager.packageInDistributableFormat (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/platformPackager.ts:119:24)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/macPackager.ts:90:26
at processImmediate (internal/timers.js:461:21)
From previous event:
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/macPackager.ts:90:10
at Generator.next ()
From previous event:
at MacPackager.pack (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/macPackager.ts:80:95)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/packager.ts:430:24
at Generator.next ()
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/graceful-fs/polyfills.js:285:20
at FSReqCallback.oncomplete (fs.js:178:5)
From previous event:
at Packager.doBuild (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/packager.ts:396:24)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/packager.ts:366:57
at Generator.next ()
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/graceful-fs/graceful-fs.js:111:16
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqCallback.oncomplete (fs.js:165:23)
From previous event:
at Packager._build (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/packager.ts:335:133)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/packager.ts:331:23
at Generator.next ()
at processImmediate (internal/timers.js:461:21)
From previous event:
at Packager.build (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/packager.ts:288:14)
at build (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/app-builder-lib/src/index.ts:59:28)
at build (/Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/electron-builder/src/builder.ts:228:10)
at /Applications/XAMPP/xamppfiles/htdocs/custom/node_modules/electron-builder/src/cli/cli.ts:46:19
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.