NPAPI:BrowserZoomLevelQuery: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(NPAPI Browser Zoom Level initial spec)
 
(Changed browser zoom to Browser CSS Zoom to make zoom more specific, added requirement for NPP_SetValue)
Line 1: Line 1:
== Status  ==
== Status  ==


Initial draft
Initial Draft


== Contributors  ==
== Contributors  ==


*Last modified: 2015-12-21
*Last modified: 2016-01-28
*Authors: Kyle Machulis (Mozilla)
*Authors: Kyle Machulis (Mozilla)


Line 11: Line 11:


Currently, NPAPI plugins have no way to know if the browser is running
Currently, NPAPI plugins have no way to know if the browser is running
at a zoom level other than 1x. We need an addition to the API that
at a CSS zoom level other than 1x. We need an addition to the API that
allows plugins to query the current browser zoom level.
allows plugins to query the current browser CSS zoom level.


== Specification  ==
== Specification  ==
Line 19: Line 19:


<pre> 
<pre> 
NPNVbrowserZoomFactor = 23
NPNVbrowserCSSZoomFactor = 23
</pre>
</pre>


This can be retrieved via NPN_GetValue, and will return a double
This can be retrieved via NPN_GetValue, and will return a double
representing the current zoom level of the browser. Since changing
representing the current CSS zoom level of the browser. Since changing CSS
zoom levels updates the window properties, this value can be re-queried
zoom levels updates the window properties, this value can be re-queried
during NPN_SetWindow or other window property update calls, to see if
during NPN_SetWindow or other window property update calls, to see if
a zoom change has been made.
a zoom change has been made. It will also be sent via NPP_SetValue so that
plugins can be notified when it changes.


== Relevant Bugs ==
== Relevant Bugs ==


[https://bugzilla.mozilla.org/show_bug.cgi?id=1171182 Bug 1171182 - Implement browser zoom query in NPAPI]
[https://bugzilla.mozilla.org/show_bug.cgi?id=1171182 Bug 1171182 - Implement browser zoom query in NPAPI]

Revision as of 00:20, 29 January 2016

Status

Initial Draft

Contributors

  • Last modified: 2016-01-28
  • Authors: Kyle Machulis (Mozilla)

Overview

Currently, NPAPI plugins have no way to know if the browser is running at a CSS zoom level other than 1x. We need an addition to the API that allows plugins to query the current browser CSS zoom level.

Specification

We'll need to add a NPNV variable:

  	
NPNVbrowserCSSZoomFactor = 23

This can be retrieved via NPN_GetValue, and will return a double representing the current CSS zoom level of the browser. Since changing CSS zoom levels updates the window properties, this value can be re-queried during NPN_SetWindow or other window property update calls, to see if a zoom change has been made. It will also be sent via NPP_SetValue so that plugins can be notified when it changes.

Relevant Bugs

Bug 1171182 - Implement browser zoom query in NPAPI