优化app内链接跳转
parent
e230fa13b3
commit
8842df25dc
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "dtalk",
|
"name": "dtalk",
|
||||||
"version": "3.8.7",
|
"version": "3.8.8",
|
||||||
"description": "钉钉-Linux版",
|
"description": "钉钉-Linux版",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -36,7 +36,7 @@ exports.createMainWindow = function(icon) {
|
||||||
win.on('ready-to-show', _ => {
|
win.on('ready-to-show', _ => {
|
||||||
win.show()
|
win.show()
|
||||||
|
|
||||||
// win.openDevTools()
|
win.openDevTools()
|
||||||
})
|
})
|
||||||
|
|
||||||
win.webContents.on('dom-ready', ev => {
|
win.webContents.on('dom-ready', ev => {
|
||||||
|
@ -45,10 +45,11 @@ exports.createMainWindow = function(icon) {
|
||||||
|
|
||||||
const shell = require('electron').shell;
|
const shell = require('electron').shell;
|
||||||
|
|
||||||
// assuming $ is jQuery
|
|
||||||
$(document).on('click', 'a[href^="http"]', function(event) {
|
$(document).on('click', 'a[href^="http"]', function(event) {
|
||||||
|
if(!this.hasAttribute('nwdirectory')){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
shell.openExternal(this.href);
|
shell.openExternal(this.href);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
localStorage.setItem("isBeepOpen", "true");
|
localStorage.setItem("isBeepOpen", "true");
|
||||||
|
|
Reference in New Issue