Commit b4f15a6f authored by Sean Roberts's avatar Sean Roberts

Removing flags for multiple iframe support

parent e29a73f0
...@@ -327,7 +327,6 @@ gulp.task('serve-live-reload', ['serve-package'], function () { ...@@ -327,7 +327,6 @@ gulp.task('serve-live-reload', ['serve-package'], function () {
var LiveReloadServer = require('./scripts/gulp/live-reload-server'); var LiveReloadServer = require('./scripts/gulp/live-reload-server');
liveReloadServer = new LiveReloadServer(3000, { liveReloadServer = new LiveReloadServer(3000, {
clientUrl: `http://${packageServerHostname()}:3001/hypothesis`, clientUrl: `http://${packageServerHostname()}:3001/hypothesis`,
enableMultiFrameSupport: !!process.env.MULTI_FRAME_SUPPORT,
}); });
}); });
......
...@@ -70,16 +70,6 @@ function LiveReloadServer(port, config) { ...@@ -70,16 +70,6 @@ function LiveReloadServer(port, config) {
</html> </html>
`; `;
} else { } else {
var multiFrameContent = config.enableMultiFrameSupport ? `
<div style="margin: 10px 0 0 75px;">
<button id="add-test" style="padding: 0.6em; font-size: 0.75em">Toggle 2nd Frame</button>
</div>
<div style="margin: 10px 0 0 75px;">
<iframe id="iframe1" src="/document/license" style="width: 50%;height: 300px;"></iframe>
</div>
<div id="iframe2-container" style="margin: 10px 0 0 75px;">
</div>` : '';
content = ` content = `
<html> <html>
<head> <head>
...@@ -91,7 +81,14 @@ function LiveReloadServer(port, config) { ...@@ -91,7 +81,14 @@ function LiveReloadServer(port, config) {
Number of annotations: Number of annotations:
<span data-hypothesis-annotation-count>...</span> <span data-hypothesis-annotation-count>...</span>
</div> </div>
${multiFrameContent} <div style="margin: 10px 0 0 75px;">
<button id="add-test" style="padding: 0.6em; font-size: 0.75em">Toggle 2nd Frame</button>
</div>
<div style="margin: 10px 0 0 75px;">
<iframe id="iframe1" src="/document/license" style="width: 50%;height: 300px;"></iframe>
</div>
<div id="iframe2-container" style="margin: 10px 0 0 75px;">
</div>
<pre style="margin: 20px 75px 75px 75px;">${readmeText()}</pre> <pre style="margin: 20px 75px 75px 75px;">${readmeText()}</pre>
<script> <script>
var appHost = document.location.hostname; var appHost = document.location.hostname;
...@@ -103,8 +100,7 @@ function LiveReloadServer(port, config) { ...@@ -103,8 +100,7 @@ function LiveReloadServer(port, config) {
// Open the sidebar when the page loads // Open the sidebar when the page loads
openSidebar: true, openSidebar: true,
// Needed for multi frame support // Subframe client embed code reference
enableMultiFrameSupport: ${config.enableMultiFrameSupport},
embedScriptUrl: '${config.clientUrl}' embedScriptUrl: '${config.clientUrl}'
}; };
}; };
......
...@@ -18,10 +18,10 @@ function configFrom(window_) { ...@@ -18,10 +18,10 @@ function configFrom(window_) {
openSidebar: settings.hostPageSetting('openSidebar', {allowInBrowserExt: true}), openSidebar: settings.hostPageSetting('openSidebar', {allowInBrowserExt: true}),
branding: settings.hostPageSetting('branding'), branding: settings.hostPageSetting('branding'),
services: settings.hostPageSetting('services'), services: settings.hostPageSetting('services'),
// Needed by the multi-frame feature for now
enableMultiFrameSupport: settings.hostPageSetting('enableMultiFrameSupport'),
embedScriptUrl: settings.hostPageSetting('embedScriptUrl'), embedScriptUrl: settings.hostPageSetting('embedScriptUrl'),
// Subframe identifier given when a frame is being embedded into
// by a top level client
subFrameIdentifier: settings.hostPageSetting('subFrameIdentifier'), subFrameIdentifier: settings.hostPageSetting('subFrameIdentifier'),
// Temporary feature flag override for 1st-party OAuth // Temporary feature flag override for 1st-party OAuth
......
...@@ -51,7 +51,7 @@ $.noConflict(true)(function() { ...@@ -51,7 +51,7 @@ $.noConflict(true)(function() {
delete config.constructor; delete config.constructor;
} }
if (config.enableMultiFrameSupport && config.subFrameIdentifier) { if (config.subFrameIdentifier) {
Klass = Guest; Klass = Guest;
// Other modules use this to detect if this // Other modules use this to detect if this
......
...@@ -36,10 +36,10 @@ module.exports = class CrossFrame extends Plugin ...@@ -36,10 +36,10 @@ module.exports = class CrossFrame extends Plugin
this.pluginInit = -> this.pluginInit = ->
onDiscoveryCallback = (source, origin, token) -> onDiscoveryCallback = (source, origin, token) ->
bridge.createChannel(source, origin, token) bridge.createChannel(source, origin, token)
discovery.startDiscovery(onDiscoveryCallback) discovery.startDiscovery(onDiscoveryCallback)
if config.enableMultiFrameSupport frameObserver.observe(_injectToFrame, _iframeUnloaded);
frameObserver.observe(_injectToFrame, _iframeUnloaded);
this.destroy = -> this.destroy = ->
# super doesnt work here :( # super doesnt work here :(
......
...@@ -40,7 +40,6 @@ describe('CrossFrame multi-frame scenario', function () { ...@@ -40,7 +40,6 @@ describe('CrossFrame multi-frame scenario', function () {
options = { options = {
config: { config: {
enableMultiFrameSupport: true,
embedScriptUrl: 'data:,', // empty data uri embedScriptUrl: 'data:,', // empty data uri
}, },
on: sandbox.stub(), on: sandbox.stub(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment