You need to be logged in to post in the forums. If you do not have an account, please sign up first.
Using variables in the popup-window's dimmensionsSeems like its not working,
I would like to give users options for the dimensions because the size of the content varies, depending on other settings.
Seems I cant do that.
Also not defining the size should be on some automatic mode which would try to avoid using scrollbars at all cost or then whole extension looks terrible.
with switch and case I am able to choose from several sizes for the popup window
and with some additional css like max-width and overflow:hidden I am able to control rest of the content it seems.
Using variables will work so long as those variables are defined. You could use something like this to set a default size:
var popupWidth = parseInt(localStorage['popupWidth'] || 100); var popupHeight = parseInt(localStorage['popupHeight'] || 100);
True, but if you're just storing numbers, parseInt will do the trick. If you use JSON.parse, make sure you test for the existence of the value first (or use the || trick) as JSON.parse(undefined) gets you an exception instead of a value.