File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1- const { ipcRenderer, remote, clipboard } = require ( 'electron' )
1+ const { ipcRenderer, remote, clipboard, shell } = require ( 'electron' )
22const { Menu } = remote
33
44const os = remote . require ( 'os' )
@@ -35,7 +35,7 @@ window.onload = () => {
3535 targetURL = getServerUrl ( )
3636 }
3737
38- document . body . innerHTML += `<webview src="${ targetURL } " id="main-window" disablewebsecurity autosize="on" allowpopups allowfileaccessfromfiles></webview>`
38+ document . body . innerHTML += `<webview src="${ targetURL } " id="main-window" autosize="on" allowpopups allowfileaccessfromfiles></webview>`
3939
4040 const webview = document . getElementById ( 'main-window' )
4141
@@ -203,10 +203,18 @@ window.onload = () => {
203203
204204 $ ( '#open-from-url-modal.modal #submit-file-url' ) . click ( function ( ) {
205205 let url = $ ( '#open-from-url-modal.modal input[type="text"]' ) . val ( )
206- if ( url . length > 0 ) {
206+ const serverurl = getServerUrl ( )
207+ if ( url . length <= 0 ) {
208+ return
209+ }
210+
211+ if ( ! url . match ( serverurl ) ) {
212+ shell . openExternal ( url )
213+ } else {
207214 ipcClient ( 'createWindow' , { url : `file://${ path . join ( __dirname , `index.html?target=${ url } ` ) } ` } )
208- $ ( '#open-from-url-modal.modal' ) . modal ( 'hide' )
209215 }
216+
217+ $ ( '#open-from-url-modal.modal' ) . modal ( 'hide' )
210218 } )
211219
212220 /* handle _target=blank pages */
You can’t perform that action at this time.
0 commit comments