From 2a8536c386772e7781b5a449ee1bcf6f5657594c Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Wed, 7 Apr 2021 09:49:09 +0000 Subject: [PATCH 1/2] Allow insecure url in imjoy plugins --- .../api/static/public/http_base_frame.html | 15 +++++++++++++++ .../tabContentComponents/imjoyContent.vue | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 openflexure_microscope/api/static/public/http_base_frame.html diff --git a/openflexure_microscope/api/static/public/http_base_frame.html b/openflexure_microscope/api/static/public/http_base_frame.html new file mode 100644 index 00000000..627e08e5 --- /dev/null +++ b/openflexure_microscope/api/static/public/http_base_frame.html @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue index c5443937..7a4ac383 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue @@ -122,6 +122,12 @@ export default { mounted() { const self = this; const imjoy = new imjoyCore.ImJoy({ + // We will load the ImJoy plugin base frame via http (instead of https) + // such that imjoy plugins can access insecured urls + // however, some browser features won't work (e.g. webrtc) + // unless we explicitly set `base_frame` in the plugin to + // https://lib.imjoy.io/default_base_frame.html + default_base_frame: '/http_base_frame.html', imjoy_api: { async showDialog(plugin, config, exta_config) { return await imjoy.pm.createWindow(plugin, config, exta_config); From ab2523e23162d20417ebda2f8af34e6eb270c557 Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Wed, 7 Apr 2021 10:05:27 +0000 Subject: [PATCH 2/2] Use official version of default_base_frame.html --- .../api/static/public/http_base_frame.html | 15 --------------- .../tabContentComponents/imjoyContent.vue | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 openflexure_microscope/api/static/public/http_base_frame.html diff --git a/openflexure_microscope/api/static/public/http_base_frame.html b/openflexure_microscope/api/static/public/http_base_frame.html deleted file mode 100644 index 627e08e5..00000000 --- a/openflexure_microscope/api/static/public/http_base_frame.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue index 7a4ac383..f3489f4d 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/imjoyContent.vue @@ -127,7 +127,7 @@ export default { // however, some browser features won't work (e.g. webrtc) // unless we explicitly set `base_frame` in the plugin to // https://lib.imjoy.io/default_base_frame.html - default_base_frame: '/http_base_frame.html', + default_base_frame: 'http://lib.imjoy.io/default_base_frame.html', imjoy_api: { async showDialog(plugin, config, exta_config) { return await imjoy.pm.createWindow(plugin, config, exta_config);