PenetrationTestingScripts/antSword/source/modules/plugin/index.js

52 lines
942 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* 插件中心
* 开写2016/05/09
* 更新:-
* 作者:蚁逅 <https://github.com/antoor>
*/
'use strict';
const path = global.require('path');
class Plugin {
constructor() {
// 注册菜单事件
antSword['menubar'].reg(
'plugin-store',
this.initWin.bind(this, 'ant-views://plugin.html')
);
this.win = null;
}
/**
* 初始化新窗口
* @param {String} url 要加载的URL
* @return {Object} BrowserWindow窗口对象
*/
initWin(url) {
if (this.win) {
return this.win.focus();
}
let win = new antSword['remote'].BrowserWindow({
width: 930,
height: 666,
minWidth: 888,
minHeight: 555,
show: false,
title: 'AntSword.Store'
});
win.on('close', () => {
this.win = win = null;
});
win.loadURL(url);
win.show();
// win.openDevTools();
this.win = win;
}
}
module.exports = Plugin;