简体   繁体   English

更改Chrome扩展程序窗口的位置和大小

[英]Change the position and size of Chrome extension window

We want to change the position and height of the chrome extension window when we click the extension icon in the browser. 当我们在浏览器中单击扩展程序图标时,我们想更改chrome扩展程序窗口的位置和高度。 The extension is not popup window. 该扩展名不是弹出窗口。 We are going to do it using Javascript. 我们将使用Javascript来实现。 Can you give me some codes please on how to do this? 能否请您给我一些有关如何执行此操作的代码?

Not sure why if the popup window isn't in use at all, you'd care about its dimensions and location. 不知道为什么根本不使用弹出窗口,您会关心它的尺寸和位置。 Why show it? 为什么要显示?

That being said, height and width can be changed. 就是说,高度和宽度可以改变。 Simply set them in css for html and body elements. 只需在CSS中将它们设置为htmlbody元素即可。 If by changing position you mean that upon click the popup would open in the center of the screen (for example), as far as I know, this cannot be done. 据我所知,如果改变位置是指单击后弹出窗口将在屏幕中央打开(例如),则无法完成。 It must point to the extension's icon. 它必须指向扩展程序的图标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM