1

I'm trying to create a addon that resizes the current Firefox window. I have realized that I should use the pageMod to include a contentScriptFile to inject a script into the current page. From there I'm trying to do window.resizeTo(400, 800); but it does nothing. I can get the window.innerWidth so the window object is working. I have also tried firing the resizeTo with self.port.on but with no luck.

Filip
  • 2,514
  • 17
  • 28

1 Answers1

1

It seems that it could be because of limitation of window.resizeTo()

Please refer to - Javascript's `window.resizeTo` isn't working.

As mentioned in above link - there are two rules that applies:

1) Can't resize a window/tab that hasn't been created by window.open.
2) Can't resize a tab if the tab is in a window with more than one tab.

Also, make sure that resizing is enabled in FF by JS (Go to Firefox > Options > Options > Content(Sub-tab) and then click on Advanced Button beside Enable Javascript)

Community
  • 1
  • 1
prasun
  • 7,073
  • 9
  • 41
  • 59