diff --git a/extension/background.js b/extension/background.js index 94506ad..6a0025f 100644 --- a/extension/background.js +++ b/extension/background.js @@ -385,6 +385,7 @@ chrome.windows.onFocusChanged.addListener(logEventWrapper("windows.onFocusChange chrome.windows.onBoundsChanged.addListener(async (window) => { // remember position of topic manager window + if (BTManagerHome === 'SIDEPANEL') return; // doesn't apply const [BTTab, BTWin] = await getBTTabWin(); if (BTWin != window.id) return; const location = {top: window.top, left: window.left, width: window.width, height: window.height}; diff --git a/extension/sidePanel.js b/extension/sidePanel.js index 518e6de..33443c8 100644 --- a/extension/sidePanel.js +++ b/extension/sidePanel.js @@ -18,8 +18,13 @@ let BTPort; const contentScripts = manifest.content_scripts; const match = contentScripts[0].matches[0]; const localhost = match.includes('localhost'); - const version = manifest.version; + let version = manifest.version; + // version is x.y.z or x.y, need to strip off the .z if present + const parts = version.split('.'); + if (parts.length > 2) version = parts.slice(0, 2).join('.'); + const url = match.replace(/\*+$/, '') + (localhost ? '' : (version + '/app')); + const iframe = document.getElementById('BTTopicManager'); iframe.src = url; })(); diff --git a/versions/1.2/extension/sidePanel.js b/versions/1.2/extension/sidePanel.js index 518e6de..33443c8 100644 --- a/versions/1.2/extension/sidePanel.js +++ b/versions/1.2/extension/sidePanel.js @@ -18,8 +18,13 @@ let BTPort; const contentScripts = manifest.content_scripts; const match = contentScripts[0].matches[0]; const localhost = match.includes('localhost'); - const version = manifest.version; + let version = manifest.version; + // version is x.y.z or x.y, need to strip off the .z if present + const parts = version.split('.'); + if (parts.length > 2) version = parts.slice(0, 2).join('.'); + const url = match.replace(/\*+$/, '') + (localhost ? '' : (version + '/app')); + const iframe = document.getElementById('BTTopicManager'); iframe.src = url; })();