madfish-solutions/templewallet-extension

Chrome extension issue : Bounds must be at least 50% ...

Closed this issue · 2 comments

Using chrome on 3 screens, when the wallet is locked after inactivity, then I try to connect on a dapp with Temple extension, nothing happens ... I mean the dapp is waiting for the extension response

When looking on extension logs , we can see that there is an error message on the console : "Bounds must be at least 50% .."

It means that the calculation of windows size on windows is wrong , dapp.ts

  const confirmWin = await browser.windows.create({
    type: 'popup',
    url: browser.runtime.getURL(`confirm.html#?id=${id}`),
    width: isWin ? CONFIRM_WINDOW_WIDTH + 16 : CONFIRM_WINDOW_WIDTH,
    height: isWin ? CONFIRM_WINDOW_HEIGHT + 17 : CONFIRM_WINDOW_HEIGHT,
    top: Math.max(top, 20),
    left: Math.max(left, 20)
  });

my ugly workaround to check this is

  const confirmWin = await browser.windows.create({
    type: 'popup',
    url: browser.runtime.getURL(`confirm.html#?id=${id}`),
    width: 500,
    height: 500
  });

windows, then appears and all is fine.

Not the first time I have this behavior, I never found the root cause of this, but now I know why.

Please try to reproduce and fix the dimensions

@zamrokk, thank you for reporting this issue, and providing a good pointer!

Fix PR: #840

You're welcome