mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 13:39:58 +01:00
riot-desktop open SSO in browser so user doesn't have to auth twice
This commit is contained in:
parent
40eec12b86
commit
abe074e43e
@ -24,5 +24,20 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.device.audio-input</key>
|
<key>com.apple.security.device.audio-input</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
|
||||||
|
<!-- Entitlements to support the riot:// protocol handler -->
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>riot</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>riot-web</string>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>None</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -103,6 +103,10 @@
|
|||||||
"directories": {
|
"directories": {
|
||||||
"output": "dist"
|
"output": "dist"
|
||||||
},
|
},
|
||||||
"afterSign": "scripts/electron_afterSign.js"
|
"afterSign": "scripts/electron_afterSign.js",
|
||||||
|
"protocols": [{
|
||||||
|
"name": "riot",
|
||||||
|
"schemes": ["riot"]
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ const tray = require('./tray');
|
|||||||
const vectorMenu = require('./vectormenu');
|
const vectorMenu = require('./vectormenu');
|
||||||
const webContentsHandler = require('./webcontents-handler');
|
const webContentsHandler = require('./webcontents-handler');
|
||||||
const updater = require('./updater');
|
const updater = require('./updater');
|
||||||
|
const protocolInit = require('./protocol');
|
||||||
|
|
||||||
const windowStateKeeper = require('electron-window-state');
|
const windowStateKeeper = require('electron-window-state');
|
||||||
const Store = require('electron-store');
|
const Store = require('electron-store');
|
||||||
@ -511,6 +512,9 @@ if (!gotLock) {
|
|||||||
app.exit();
|
app.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do this after we know we are the primary instance of the app
|
||||||
|
protocolInit();
|
||||||
|
|
||||||
// Register the scheme the app is served from as 'standard'
|
// Register the scheme the app is served from as 'standard'
|
||||||
// which allows things like relative URLs and IndexedDB to
|
// which allows things like relative URLs and IndexedDB to
|
||||||
// work.
|
// work.
|
||||||
|
@ -198,19 +198,10 @@ function onEditableContextMenu(ev, params) {
|
|||||||
|
|
||||||
module.exports = (webContents) => {
|
module.exports = (webContents) => {
|
||||||
webContents.on('new-window', onWindowOrNavigate);
|
webContents.on('new-window', onWindowOrNavigate);
|
||||||
// XXX: The below now does absolutely nothing because of
|
webContents.on('will-navigate', (ev, target) => {
|
||||||
// https://github.com/electron/electron/issues/8841
|
if (target.startsWith("vector://")) return;
|
||||||
// Whilst this isn't a security issue since without
|
return onWindowOrNavigate(ev, target);
|
||||||
// node integration and with the sandbox, it should be
|
});
|
||||||
// no worse than opening the site in Chrome, it obviously
|
|
||||||
// means the user has to restart Riot to make it usable
|
|
||||||
// again (often unintuitive because it minimises to the
|
|
||||||
// system tray). We therefore need to be vigilant about
|
|
||||||
// putting target="_blank" on links in Riot (although
|
|
||||||
// we should generally be doing this anyway since links
|
|
||||||
// navigating you away from Riot in the browser is
|
|
||||||
// also annoying).
|
|
||||||
webContents.on('will-navigate', onWindowOrNavigate);
|
|
||||||
|
|
||||||
webContents.on('context-menu', function(ev, params) {
|
webContents.on('context-menu', function(ev, params) {
|
||||||
if (params.linkURL || params.srcURL) {
|
if (params.linkURL || params.srcURL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user