Closed Bug 685932 Opened 13 years ago Closed 7 years ago

windows module should provide height/width properties

Categories

(Add-on SDK Graveyard :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: dietrich, Unassigned)

References

Details

currently there is no way to get this information without punching through into chrome, or using a page-mod to window outer dimensions. using a page-mod works in some cases, but is anti-ergonomic, requiring a bunch of message passing infrastructure and event listeners to get two very basic properties. a situation where the page-mod hack does not work is when you have a panel that you want to size as a proportion of the window size. well, i guess you could write code to do shit like find an open browser window and attach a page-mod to it's active tab's content and etc, but the infrastructure required becomes absurd. at first glance, 3 additions to the current api would help: window.height // outer height window.width // outer width a 'resize' event
Severity: normal → enhancement
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
I think we should leave this to a 3rd party module, Irakli do you agree?
Blocks: sdk/windows
Flags: needinfo?(rFobic)
Can you explain why you think that?
I think adding window.height / width and resize event is quite reasonable and in fact is far better solution than encouraging ppl to use page-mod for that. So I'm +1 on adding those to the window object. Dietrich btw now there is a better workaround as you can get chrome object for any sdk object via require("sdk/view/core").viewFor(window), so you could implement simple getWidth getHeight as getWidth = window => require("sdk/view/core").viewFor(window).outerWidth
Flags: needinfo?(rFobic)
Summary: addon-kit windows module should provide height/width properties → windows module should provide height/width properties
Whiteboard: [good first bug]
Because of the difficulty finding mentors and the expected life span of the SDK, we are removing [good first bug] from remaining SDK bugs.
Whiteboard: [good first bug]
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.