[BEX] Quasar BEX 提供的那些配置

 

Manifest.json

https://developer.chrome.com/extensions/manifest

 

Background Script & Content Script

Background Script - 运行在BEX本身的上下文中,可以监听所有可用的浏览器扩展事件。每个BEX只能有一个后台脚本实例。

Content Script - 在网页的上下文中运行。将有一个新的内容脚本实例每个标签运行扩展。

 

给网页上下文运行一个 Content Script,意味着只有和网页交互的 BEX 才能使用这个 Content Script。

Popups,Options,Devtools 背后不会有 Content Script。它们都有一个 Background Script。

 

CSS

任何对当前Web页面可用的 CSS 放置在  src-bex/css/content-css.css,因为这个文件被注入到了 manifest.json 中。

必须是原生CSS,不提供 SASS/Stylus。

 

Hook Files

Quasar BEX 中,提供了  background-hook.jscontent-hook.js 和 dom-hook.js.

这些文件为 BEX 各层间的通信提供了桥梁。更多细节参考:BEX Communication / Events.

 

Ref:https://quasar.dev/quasar-cli/developing-browser-extensions/configuring-bex

Link:https://www.cnblogs.com/farwish/p/14920759.html

posted on 2021-06-22 23:15  ercom  阅读(117)  评论(0编辑  收藏  举报