如果我console.log('something');从弹出页面或其他任何脚本调用它,它可以正常工作.
但是,由于后台页面没有直接从弹出页面运行,因此它不包含在控制台中.
有没有办法让我可以console.log()在后台页面显示弹出页面的控制台?
有没有办法,从后台页面调用弹出页面中的一个函数?
我尝试使用 angular CLI 开发一个简单的 Google Chrome 扩展程序,但它卡在Loading.
如果我尝试正常使用我的应用程序npm start并在浏览器的窗口中打开它,它工作正常。
我也尝试使用编译我的应用程序ng build,将我的manifest.json放在我的dist文件夹中,但结果是一样的。
我的 manifest.json :
{
"manifest_version": 2,
"name": "Weather for Chrome",
"description": "Weather for Chrome is a simple Google chrome plugin using angular CLI",
"version": "1.0",
"browser_action": {
"default_icon": "assets/Soleil.png",
"default_popup": "index.html"
},
"permissions": [
"activeTab",
"https://ajax.googleapis.com/"
]
}
Run Code Online (Sandbox Code Playgroud)
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { …Run Code Online (Sandbox Code Playgroud) plugins google-chrome-extension typescript angular-cli angular