Commit e3c14593 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Simplification of code

A few lines have been removed as a result of the code simplification.
parent a5c587c8
......@@ -42,8 +42,6 @@ export class CrossFrame {
return;
}
const { clientUrl } = config;
frameUtil.isLoaded(frame, () => {
const subFrameIdentifier = discovery.generateToken();
frameIdentifiers.set(frame, subFrameIdentifier);
......@@ -52,6 +50,7 @@ export class CrossFrame {
subFrameIdentifier,
};
const { clientUrl } = config;
frameUtil.injectHypothesis(frame, clientUrl, injectedConfig);
});
};
......
......@@ -47,10 +47,10 @@ export default class Discovery {
* Set whether this frame acts as a server (fetches annotations from the
* API) or a client (contains annotatable content and displays highlights).
*/
this.server = false;
this.server = options.server ?? false;
/** Origins allowed to communicate with this frame. */
this.origin = '*';
this.origin = options.origin ?? '*';
/**
* Flag set in client frames to indicate when they are waiting for a
......@@ -60,14 +60,6 @@ export default class Discovery {
this.onDiscovery = null;
if (typeof options.server !== 'undefined') {
this.server = options.server;
}
if (typeof options.origin !== 'undefined') {
this.origin = options.origin;
}
this._onMessage = this._onMessage.bind(this);
this._listeners = new ListenerCollection();
}
......
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