mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Open external links in web browser (#506)
This commit is contained in:
parent
d821b18346
commit
b8c1d78157
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CubeSpinner from "@/components/CubeSpinner";
|
import CubeSpinner from "@/components/CubeSpinner";
|
||||||
import { webviewTag } from 'electron';
|
import { remote, shell } from 'electron';
|
||||||
export default {
|
export default {
|
||||||
name: "ClusterPage",
|
name: "ClusterPage",
|
||||||
components: {
|
components: {
|
||||||
@ -92,6 +92,10 @@ export default {
|
|||||||
lensLoaded: function() {
|
lensLoaded: function() {
|
||||||
console.log("lens loaded")
|
console.log("lens loaded")
|
||||||
this.lens.loaded = true;
|
this.lens.loaded = true;
|
||||||
|
remote.webContents.fromId(this.lens.webview.getWebContentsId()).on('new-window', (e, url) => {
|
||||||
|
e.preventDefault()
|
||||||
|
shell.openExternal(url)
|
||||||
|
})
|
||||||
this.$store.commit("updateLens", this.lens);
|
this.$store.commit("updateLens", this.lens);
|
||||||
},
|
},
|
||||||
// Called only when online state changes
|
// Called only when online state changes
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user