在Google Chrome中创建面板 [英] Creating a panel in Google Chrome

查看:144
本文介绍了在Google Chrome中创建面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个插件从Firefox移到Chrome。在Firefox中,可以创建一个连接到当前窗口的独立面板,而不是您在Chrome中弹出的窗口。

我知道Chrome允许您将脚本插入页面。如何使用脚本插入方式将窗格添加到窗口底部,而不会改变布局?

感谢。

解决方案

Chrome API不提供任何帮助有了这个。您需要通过内容脚本手动插入和定位面板div。



如何设置样式:


  • 为面板设置 position:fixed; bottom:0;
  • 设置 margin-bottom 页面正文等于面板高度
  • 查找页面上具有底部的绝对定位元素 value设置并通过面板高度减小。

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 panel 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.

这篇关于在Google Chrome中创建面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆