开发者

Creating a panel in Google Chrome

开发者 https://www.devze.com 2023-03-09 22:05 出处:网络
I\'m moving a plugin from Firefox to Chrome. In Firefox its possible to create a separate panel attached to the current window instead of the popup you get in chrome.

I'm moving a plugin from Firefox to Chrome. In Firefox its possible to create a separate panel attached to the current window instead of the popup you get in chrome.

I know Chrome allows you to insert scripts into a page. How would I add a pa开发者_StackOverflow社区nel to the bottom of the window using script insertion in a way that doesn't alter the layout?

Thanks.


Chrome API doesn't provide any help with this. You would need to insert and position the panel div manually through content script.

How to do style it:

  • Set position:fixed;bottom:0; for the panel
  • Set margin-bottom of the page body equal to panel height
  • Look for absolutely positioned elements on the page that have bottom value set and decrease it by panel height.
0

精彩评论

暂无评论...
验证码 换一张
取 消