remote testing on dev env and nodeintegration on webview
This commit is contained in:
parent
7fe0be8c16
commit
2991a92b68
3 changed files with 24 additions and 3 deletions
|
@ -657,7 +657,12 @@ export class BrowserWindow {
|
||||||
|
|
||||||
ipcMain.on('get-remote-pair-url', (_event, _) => {
|
ipcMain.on('get-remote-pair-url', (_event, _) => {
|
||||||
let url = `http://${BrowserWindow.getIP()}:${this.remotePort}`;
|
let url = `http://${BrowserWindow.getIP()}:${this.remotePort}`;
|
||||||
|
if (app.isPackaged) {
|
||||||
BrowserWindow.win.webContents.send('send-remote-pair-url', (`https://cider.sh/pair-remote?url=${Buffer.from(encodeURI(url)).toString('base64')}`).toString());
|
BrowserWindow.win.webContents.send('send-remote-pair-url', (`https://cider.sh/pair-remote?url=${Buffer.from(encodeURI(url)).toString('base64')}`).toString());
|
||||||
|
} else {
|
||||||
|
BrowserWindow.win.webContents.send('send-remote-pair-url', (`http://127.0.0.1:5500/pair-remote.html?url=${Buffer.from(encodeURI(url)).toString('base64')}`).toString());
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
if (process.platform === "darwin") {
|
if (process.platform === "darwin") {
|
||||||
app.setUserActivity('com.CiderCollective.remote.pair', {
|
app.setUserActivity('com.CiderCollective.remote.pair', {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template v-if="page == 'webview'">
|
<template v-if="page == 'webview'">
|
||||||
<div style="display:flex;width:100%;height:100%">
|
<div style="display:flex;width:100%;height:100%">
|
||||||
<webview id="foo" :src="webview.url" style="display:inline-flex; width:100%;"></webview>
|
|
||||||
|
<<webview id="foo" :src="webview.url" nodeintegration="true" style="display:inline-flex; width:100%;"></webview>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -55,6 +55,21 @@ var app = new Vue({
|
||||||
// url: "localhost",
|
// url: "localhost",
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isElectron() {
|
||||||
|
// Renderer process
|
||||||
|
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Main process
|
||||||
|
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Detect the user agent when the `nodeIntegration` option is set to true
|
||||||
|
if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
searchScroll(e) {
|
searchScroll(e) {
|
||||||
this.search.lastY = e.target.scrollTop;
|
this.search.lastY = e.target.scrollTop;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue