Full page zoom 编辑
Full page zoom (or just fullZoom) is a new feature in Firefox 3.
Example (XUL:browser)
The following example demonstrates the use for the current focused browser window. This is the typical usage for a Firefox extension.
var zoom = ZoomManager.getZoomForBrowser(gBrowser.selectedBrowser); ZoomManager.enlarge(); ZoomManager.setZoomForBrowser(gBrowser.selectedBrowser, ZoomManager.MIN);
Example (XUL:iframe)
Note: This is probably out of date.
You may use the fullZoom feature for a XUL:iframe as well. However, because an iframe doesn't have a markupDocumentViewer property, we need to get that first:
var zoom = 1.5; var iframe = document.getElementById("authorFrame"); var contViewer = iframe.docShell.contentViewer; var docViewer = contViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); docViewer.fullZoom = zoom;
References
- Page zoom extension by Ted Mielczarek fullpagezoom.xpi for latest Firefox 3.0 nightlies
- Glazoom extension by Daniel Glazman for Firefox 3.0
- The bugzilla bug about fullZoom.
nsIMarkupDocumentViewer
Interface documentation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论