Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
674 views
in Technique[技术] by (71.8m points)

html - How Can I Expand The Popup Window of My Chrome Extension

enter image description here

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 >

I tried (in body css) width: 1280px; height: 800px; -but no luck. It's not working correctly...

UPDATE: Similar question( maybe a duplicate ? ); chrome extension, popup window's height

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.

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:

http://groups.google.com/a/chromium.org/group/chromium-extensions/browse_thread/thread/9c921612e2692376

Increase max popup width in a Chrome extension?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...