aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes/googledrive/package.json2
-rw-r--r--recipes/googledrive/webview-unsafe.js16
-rw-r--r--recipes/googledrive/webview.js23
3 files changed, 24 insertions, 17 deletions
diff --git a/recipes/googledrive/package.json b/recipes/googledrive/package.json
index 20c2d39..725c25b 100644
--- a/recipes/googledrive/package.json
+++ b/recipes/googledrive/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "googledrive", 2 "id": "googledrive",
3 "name": "Google Drive", 3 "name": "Google Drive",
4 "version": "1.0.7", 4 "version": "2.0.0",
5 "description": "Google Drive", 5 "description": "Google Drive",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Djonathan Goulart<d.goulart@outlook.com.br>", 7 "author": "Djonathan Goulart<d.goulart@outlook.com.br>",
diff --git a/recipes/googledrive/webview-unsafe.js b/recipes/googledrive/webview-unsafe.js
new file mode 100644
index 0000000..9198ac5
--- /dev/null
+++ b/recipes/googledrive/webview-unsafe.js
@@ -0,0 +1,16 @@
1const notImplemented = () => {
2 console.warn('chrome.runtime is not implemented');
3};
4
5window.chrome = {
6 runtime: {
7 connect: () => ({
8 onMessage: {
9 addListener: notImplemented,
10 removeListener: notImplemented,
11 },
12 postMessage: notImplemented,
13 disconnect: notImplemented,
14 }),
15 },
16};
diff --git a/recipes/googledrive/webview.js b/recipes/googledrive/webview.js
index 64a0219..1678825 100644
--- a/recipes/googledrive/webview.js
+++ b/recipes/googledrive/webview.js
@@ -1,16 +1,7 @@
1module.exports = (Franz, options) => { 1"use strict";
2 window.chrome = { 2
3 runtime: { 3const path = require('path');
4 connect: () => { 4
5 return { 5module.exports = (Franz) => {
6 onMessage: { 6 Franz.injectJSUnsafe(path.join(__dirname, 'webview-unsafe.js'));
7 addListener: () => {console.warn('chrome.runtime is not implemented')}, 7};
8 removeListener: () => {console.warn('chrome.runtime is not implemented')},
9 },
10 postMessage: () => {console.warn('chrome.runtime is not implemented')},
11 disconnect: () => {console.warn('chrome.runtime is not implemented')},
12 }
13 }
14 }
15 }
16} \ No newline at end of file