Skip to content

Commit

Permalink
don't set window bounds when TM is in sidepanel cos it gets the paren…
Browse files Browse the repository at this point in the history
…t windows dimensions. Also changes for 1.2.1 were missed from sidepanel
  • Loading branch information
tconfrey committed Dec 19, 2024
1 parent 178b028 commit 60a740f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
7 changes: 6 additions & 1 deletion extension/sidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})();
Expand Down
7 changes: 6 additions & 1 deletion versions/1.2/extension/sidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})();
Expand Down

0 comments on commit 60a740f

Please sign in to comment.