我正在尝试实现一个简单的Chrome扩展程序,该扩展程序的内容不在默认弹出窗口上,而是在侧边栏上呈现。我已经意识到要这样做,由于其默认的chrome扩展弹出式样式行为(必须限制其最大宽度为800px,高度为600px,并且无法设置其位置样式),因此我必须使用iframe。
链接上方是Angular Chrome扩展脚手架项目的github存储库,我正在尝试使用Angular构建chrome扩展。
{
"manifest_version": 2,
"name": "extension test",
"short_name": "extension test",
"version": "1.0.0",
"description": "extension test",
"permissions": [
"tabs",
"downloads",
"storage",
"activeTab",
"declarativeContent"
],
"browser_action": {
"default_popup": "index.html",
"default_title": "extension test",
"default_icon": {
"16": "assets/images/favicon-16.png",
"32": "assets/images/favicon-32.png",
"48": "assets/images/favicon-48.png",
"128": "assets/images/favicon-128.png"
}
},
"options_ui": {
"page": "index.html#/option",
"open_in_tab": false
},
"content_scripts": [
{
"js": ["contentPage.js"],
"matches": ["<all_urls>"]
}
],
"background": {
"scripts": ["backgroundPage.js"],
"persistent": false
},
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"default_icon": {
"16": "assets/images/favicon-16.png", …Run Code Online (Sandbox Code Playgroud) 在早期阶段(即创建 DOM 之后)有断点表明该段落的字体系列值是字体“Montserrat-Bold”,它是通过 @font-face css 添加的,但实际渲染的显示显示为默认字体。
在这里,一段时间后的断点表明段落元素实际上已按预期设置了样式(使用字体系列)。
我假设有一个浏览器实际渲染(或应用)字体样式的过程。有没有办法知道或检测何时发生这种情况?