如何扩展我的 Chrome 扩展程序的弹出窗口 [英] How Can I Expand The Popup Window of My Chrome Extension
问题描述
我想展开当用户点击扩展按钮时弹出的窗口...
I want to expand the popup window which comes from when user click the extension button...
(我想把弹出窗口的大小扩大到红色区域)
(I want to expand the size of pop-up window to red area)
这是我用来显示弹出窗口的代码;
Here is the code that I'm using to show pop-up;
< style type="text/css" >
body {
min-width: 1005px; /* your desired width */
max-width: 100%;
position: relative;
vertical-align:middle;
}
< /style >
< iframe src="http://stackoverflow.com" width="100%" height="100%" scrolling="auto" > < /iframe >
我试过(在 body css 中)width: 1280px;高度:800px;- 但没有运气.它无法正常工作...
更新:类似的问题(可能是重复的?);chrome 扩展,弹出窗口的高度
UPDATE: Similar question( maybe a duplicate ? ); chrome extension, popup window's height
推荐答案
Chrome 扩展弹出窗口的最大高度为 600 像素,最大宽度为 800 像素. 更改宽度或高度在 html 或 body 元素上使用 CSS 只会在超过这些最大值时导致滚动条(如您所见).使用类似 window.resizeBy(x,y)
将没有效果.
Chrome extension popups can have a maximum height of 600px and maximum width of 800px. Changing the width or height using CSS on the html or body element will just cause scroll bars (as you have noticed) when over these maximums. Using something like window.resizeBy(x,y)
will have no effect.
您可以使用 CSS 隐藏滚动条,但这不会产生使页面大于 Chrome 规定的最大值的预期效果.
You can hide the scrollbars using CSS but that will not have the desired effect of making the page bigger than the maximums imposed by Chrome.
一种选择可能是在单击浏览器/页面操作时在页面中使用 JavaScript 对话框/模式,而不是使用内置弹出窗口.
One option might be to use a JavaScript dialog/modal in the page when the browser/page action is clicked instead of using the built in popup.
对类似问题的一些参考:
Some references to similar questions:
这篇关于如何扩展我的 Chrome 扩展程序的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!