Merge branch 'master' of https://github.com/SideQuestVR/SideQuest into hotfix/page_crashing
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
<app-loading-spinner #spinner></app-loading-spinner>
|
||||
<app-status-bar #status (getHelp)="getHelpModal.openModal(); helpStatus = $event; setExterHelp()"></app-status-bar>
|
||||
<webview id="mainWebView" #webview httpreferrer="https://sdiequestvr.com" [attr.src]="webUrl" allowpopups [ngStyle]="{'left':webService.isWebviewOpen?'0':'-100%'}" class="bsaber-webview" ></webview>
|
||||
<webview id="mainWebView" #webview httpreferrer="https://sdiequestvr.com" [attr.src]="webUrl" allowpopups [ngStyle]="{'left':webService.isWebviewOpen?'0':'-100%'}" class="bsaber-webview" partition='webview-partition'></webview>
|
||||
|
||||
<mz-modal #getHelpModal [fixedFooter]="true">
|
||||
<mz-modal-header>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Injectable, isDevMode } from '@angular/core';
|
||||
import { AppService } from './app.service';
|
||||
import { environment } from '../environments/environment';
|
||||
import { OPEN_IN_SYSTEM_BROWSER_DOMAINS } from '../../../electron/external-urls';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -45,12 +46,22 @@ export class WebviewService {
|
||||
.bsaber-tooltip.-sidequest-remove::after {
|
||||
content: "Remove Custom Level";
|
||||
}`;
|
||||
let ses = this.appService.remote.session.fromPartition('webview-partition');
|
||||
ses.webRequest.onBeforeRequest((details, callback) => {
|
||||
let url = details.url;
|
||||
const extUrl = new URL(url).host.toLowerCase();
|
||||
if (OPEN_IN_SYSTEM_BROWSER_DOMAINS.includes(extUrl)) {
|
||||
this.appService.electron.shell.openExternal(url);
|
||||
callback({ cancel: true });
|
||||
} else {
|
||||
callback({});
|
||||
}
|
||||
});
|
||||
this.webView.addEventListener('did-start-loading', e => {
|
||||
//this.currentAddress = this.webView.getURL();
|
||||
this.isWebviewLoading = true;
|
||||
this.webView.insertCSS(customCss);
|
||||
});
|
||||
this.webView.addEventListener('did-navigate-in-page', () => {
|
||||
this.webView.addEventListener('did-navigate-in-page', e => {
|
||||
this.currentAddress = this.webView.getURL();
|
||||
});
|
||||
this.webView.addEventListener('did-stop-loading', async e => {
|
||||
|
||||
+5
-9
@@ -18,16 +18,9 @@ const progress = require('request-progress');
|
||||
//without this, there's a bug in electron that makes facebook pages ruin everything, see https://github.com/electron/electron/issues/25469
|
||||
app.commandLine.appendSwitch('disable-features', 'CrossOriginOpenerPolicy');
|
||||
|
||||
const OPEN_IN_SYSTEM_BROWSER_DOMAINS = [
|
||||
'www.oculus.com',
|
||||
'oculus.com',
|
||||
'facebook.com',
|
||||
'www.facebook.com',
|
||||
'twitter.com',
|
||||
'www.twitter.com',
|
||||
];
|
||||
// const Readable = require('stream').Readable;
|
||||
import { SetPropertiesCommand } from './setproperties';
|
||||
import { OPEN_IN_SYSTEM_BROWSER_DOMAINS } from './external-urls';
|
||||
let has_port = process.argv.indexOf('--port');
|
||||
let valid_port = has_port > -1 && process.argv[has_port + 1] && Number.isInteger(Number(process.argv[has_port + 1]));
|
||||
class ADB {
|
||||
@@ -542,7 +535,10 @@ function createWindow() {
|
||||
shell.openExternal(e.url);
|
||||
return { action: 'deny' };
|
||||
}
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
console.log('could not open url', e);
|
||||
return { action: 'allow' };
|
||||
}
|
||||
}
|
||||
return { action: 'allow' };
|
||||
};
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export const OPEN_IN_SYSTEM_BROWSER_DOMAINS = [
|
||||
'www.oculus.com',
|
||||
'oculus.com',
|
||||
'facebook.com',
|
||||
'www.facebook.com',
|
||||
'twitter.com',
|
||||
'www.twitter.com',
|
||||
];
|
||||
+3
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "SideQuest",
|
||||
"productName": "SideQuest",
|
||||
"version": "0.10.25",
|
||||
"version": "0.10.26",
|
||||
"description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.",
|
||||
"repository": "https://github.com/SideQuestVR/SideQuest.git",
|
||||
"license": "UNLICENCED",
|
||||
@@ -68,7 +68,8 @@
|
||||
"build-electron/setproperties.js",
|
||||
"build-electron/state-storage.js",
|
||||
"build-electron/window.js",
|
||||
"build-electron/env-config.js"
|
||||
"build-electron/env-config.js",
|
||||
"build-electron/external-urls.js"
|
||||
],
|
||||
"asarUnpack": [
|
||||
"build/**/*"
|
||||
|
||||
Reference in New Issue
Block a user