File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
- import { contextBridge , ipcRenderer } from 'electron'
1
+ import { contextBridge , ipcRenderer , shell } from 'electron'
2
2
3
3
contextBridge . exposeInMainWorld ( 'ipcRenderer' , { //exposes to main script for global access via electron
4
4
invoke : ipcRenderer . invoke ,
5
5
on : ipcRenderer . on ,
6
- // add other methods you need
6
+ shell : shell
7
+ // add other methods to be used from electron that need to be exposed for use beforehand
7
8
} )
8
9
9
10
/**
Original file line number Diff line number Diff line change @@ -43,7 +43,13 @@ const nextTab = () => emit("nextTab");
43
43
const store = useStore ();
44
44
const toggleTutorial = () => store .toggleTutorial ();
45
45
46
- const openUrl = (url : string ) => shell .openExternal (url , { activate: true });
46
+ const openUrl = (url : string ) => {
47
+ if (window .ipcRenderer && window .ipcRenderer .shell ) {
48
+ window .ipcRenderer .shell .openExternal (url );
49
+ } else {
50
+ window .open (url , ' _blank' );
51
+ }
52
+ };
47
53
</script >
48
54
49
55
<style lang="scss" scoped>
You can’t perform that action at this time.
0 commit comments