electron-screenshots 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -0
- package/lib/screenshots.js +4 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -23,6 +23,10 @@ electron_1.app.whenReady().then(function () {
|
|
|
23
23
|
electron_1.globalShortcut.register('ctrl+shift+a', function () {
|
|
24
24
|
screenshots.startCapture();
|
|
25
25
|
});
|
|
26
|
+
// 防止不能关闭截图界面
|
|
27
|
+
electron_1.globalShortcut.register('ctrl+shift+q', function () {
|
|
28
|
+
electron_1.app.quit();
|
|
29
|
+
});
|
|
26
30
|
// 点击确定按钮回调事件
|
|
27
31
|
screenshots.on('ok', function (e, buffer, bounds) {
|
|
28
32
|
console.log('capture', buffer, bounds);
|
package/lib/screenshots.js
CHANGED
|
@@ -152,8 +152,10 @@ var Screenshots = /** @class */ (function (_super) {
|
|
|
152
152
|
if (!this.$win) {
|
|
153
153
|
return [2 /*return*/];
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
// 先清除 Kiosk 模式,然后取消全屏才有效
|
|
156
156
|
this.$win.setKiosk(false);
|
|
157
|
+
this.$win.setFullScreen(false);
|
|
158
|
+
this.$win.setSimpleFullScreen(false);
|
|
157
159
|
this.$win.blur();
|
|
158
160
|
this.$win.setBrowserView(null);
|
|
159
161
|
// 必须设置为 closable 为 true
|
|
@@ -268,6 +270,7 @@ var Screenshots = /** @class */ (function (_super) {
|
|
|
268
270
|
(_b = _this.$win) === null || _b === void 0 ? void 0 : _b.setKiosk(true);
|
|
269
271
|
});
|
|
270
272
|
}
|
|
273
|
+
this.$win.setFullScreen(process.platform === 'darwin');
|
|
271
274
|
// 设置为 false,mac 就不显示左上角关闭按钮
|
|
272
275
|
this.$win.setClosable(false);
|
|
273
276
|
this.$win.setBrowserView(this.$view);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-screenshots",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "electron 截图插件",
|
|
5
5
|
"types": "lib/screenshots.d.ts",
|
|
6
6
|
"main": "lib/screenshots.js",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"rimraf": "^3.0.2",
|
|
59
59
|
"typescript": "^4.5.5"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "8cfc003a0b5159255cea5e2990515fc824982b1e"
|
|
62
62
|
}
|