Error: Invalid value for argument 2. Property 'width': Value must not be less than 0.

Issue #8 new
paul irish created an issue

After tweaking the 'auto-adjust width' setting, side tabs is now not working. I get this exception when inspecting the backgroudn page.

Error in response to storage.get: Error: Invalid value for argument 2. Property 'width': Value must not be less than 0.
    at initSideTabs (chrome-extension://hlnbneddcecehdhdfbbcifjpfpfdocaj/app/chrome/background.js:10:24)
    at null.callback (chrome-extension://hlnbneddcecehdhdfbbcifjpfpfdocaj/app/chrome/background.js:65:25)
    at null.callback (chrome-extension://hlnbneddcecehdhdfbbcifjpfpfdocaj/app/chrome/background.js:36:33)

it's coming from here:

        chrome.windows.update(idCurrentChromeWindow,
            {
                'left': isLeftSide ? width : 0,
                'width': screen.width - width
            }
        );

Maybe should do a Math.min on that result?

Comments (4)

  1. Adrian Lungu repo owner

    Oh, wow, thanks for letting me know! I'll have to check this out and see if there's any way to reproduce it.

  2. Adrian Lungu repo owner

    I wasn't able to reproduce this, however, I have set it so that the width does not get saved to the preferences if it's bigger than the screen width or smaller than 30. I've also added an additional check just to make sure.

    I've just published Version 2.0.3 on the Chrome Store and it should be up any time soon. Can you check and please let me know if the issue is still present ?

    Thanks!

  3. Log in to comment