diff --git a/src/annotator/index.js b/src/annotator/index.js index 03682265f1d..8d39a21ba69 100644 --- a/src/annotator/index.js +++ b/src/annotator/index.js @@ -68,7 +68,7 @@ function init() { sidebar = new Sidebar(document.body, eventBus, guest, getConfig('sidebar')); // Expose sidebar window reference for use by same-origin guest frames. - window_.__hypothesis.sidebarWindow = sidebar.sidebarWindow; + window_.__hypothesis.sidebarWindow = sidebar.iframe.contentWindow; } // Clear `annotations` value from the notebook's config to prevent direct-linked @@ -77,7 +77,7 @@ function init() { // Set up communication between this host/guest frame and the sidebar frame. const sidebarWindow = sidebar - ? sidebar.sidebarWindow + ? sidebar.iframe.contentWindow : /** @type {HypothesisWindow} */ (window.parent).__hypothesis ?.sidebarWindow; if (sidebarWindow) { diff --git a/src/annotator/sidebar.js b/src/annotator/sidebar.js index 78c8c3c3f49..0912847cd68 100644 --- a/src/annotator/sidebar.js +++ b/src/annotator/sidebar.js @@ -67,7 +67,12 @@ export default class Sidebar { */ constructor(element, eventBus, guest, config = {}) { this._emitter = eventBus.createEmitter(); + + /** + * The `