屏幕截屏
diff --git a/platforms/browser/browser.json b/platforms/browser/browser.json
index 4b3e322..0661c52 100644
--- a/platforms/browser/browser.json
+++ b/platforms/browser/browser.json
@@ -105,6 +105,9 @@
},
"cordova-plugin-fingerprint-aio": {
"PACKAGE_NAME": "com.dalicitycard.app"
+ },
+ "cordova-plugin-prevent-screenshot-coffice": {
+ "PACKAGE_NAME": "com.dalipolice.app"
}
},
"dependent_plugins": {},
@@ -478,6 +481,14 @@
"clobbers": [
"Fingerprint"
]
+ },
+ {
+ "file": "plugins/cordova-plugin-prevent-screenshot-coffice/www/screenshot.js",
+ "id": "cordova-plugin-prevent-screenshot-coffice.screenshot",
+ "pluginId": "cordova-plugin-prevent-screenshot-coffice",
+ "clobbers": [
+ "window.plugins.preventscreenshot"
+ ]
}
],
"plugin_metadata": {
@@ -498,6 +509,7 @@
"cordova-plugin-app-version": "0.1.9",
"cordova-plugin-wkwebview-engine": "1.2.1",
"cordova-plugin-brightness": "0.1.5",
- "cordova-plugin-fingerprint-aio": "3.0.1"
+ "cordova-plugin-fingerprint-aio": "3.0.1",
+ "cordova-plugin-prevent-screenshot-coffice": "1.0.1"
}
}
diff --git a/platforms/browser/platform_www/cordova_plugins.js b/platforms/browser/platform_www/cordova_plugins.js
index 41eda28..aca6ac1 100644
--- a/platforms/browser/platform_www/cordova_plugins.js
+++ b/platforms/browser/platform_www/cordova_plugins.js
@@ -369,6 +369,14 @@
"clobbers": [
"Fingerprint"
]
+ },
+ {
+ "file": "plugins/cordova-plugin-prevent-screenshot-coffice/www/screenshot.js",
+ "id": "cordova-plugin-prevent-screenshot-coffice.screenshot",
+ "pluginId": "cordova-plugin-prevent-screenshot-coffice",
+ "clobbers": [
+ "window.plugins.preventscreenshot"
+ ]
}
];
module.exports.metadata =
@@ -391,7 +399,8 @@
"cordova-plugin-app-version": "0.1.9",
"cordova-plugin-wkwebview-engine": "1.2.1",
"cordova-plugin-brightness": "0.1.5",
- "cordova-plugin-fingerprint-aio": "3.0.1"
+ "cordova-plugin-fingerprint-aio": "3.0.1",
+ "cordova-plugin-prevent-screenshot-coffice": "1.0.1"
}
// BOTTOM OF METADATA
});
\ No newline at end of file
diff --git a/platforms/browser/platform_www/plugins/cordova-plugin-prevent-screenshot-coffice/www/screenshot.js b/platforms/browser/platform_www/plugins/cordova-plugin-prevent-screenshot-coffice/www/screenshot.js
new file mode 100644
index 0000000..120688f
--- /dev/null
+++ b/platforms/browser/platform_www/plugins/cordova-plugin-prevent-screenshot-coffice/www/screenshot.js
@@ -0,0 +1,39 @@
+cordova.define("cordova-plugin-prevent-screenshot-coffice.screenshot", function(require, exports, module) { var screenshot = {
+ enable: function (successCallback, errorCallback) {
+ cordova.exec(successCallback, errorCallback, 'screenshotName', 'enable', []);
+ },
+ disable: function (successCallback, errorCallback) {
+ cordova.exec(successCallback, errorCallback, 'screenshotName', 'disable', []);
+ },
+ registerListener : function(callback) {
+ cordova.exec(callback, callback, 'screenshotName', 'listen', []);
+
+ }
+}
+
+cordova.addConstructor(function () {
+ if (!window.plugins) {window.plugins = {};}
+
+ window.plugins.preventscreenshot = screenshot;
+ document.addEventListener("onTookScreenshot",function(){
+ console.log('tookScreenshot');
+ });
+ document.addEventListener("onGoingBackground",function(){
+ console.log('BackgroundCalled');
+ });
+ screenshot.registerListener(function(me) {
+ console.log('received listener:',me);
+ if(me === "background") {
+ var event = new Event('onGoingBackground');
+ document.dispatchEvent(event);
+ return;
+ }
+ if(me === "tookScreenshot") {
+ var event = new Event('onTookScreenshot');
+ document.dispatchEvent(event);
+ return;
+ }
+ });
+ return window.plugins.preventscreenshot;
+});
+});