-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自己写的web extension无法加载入口js文件 #65
Comments
运行的是 |
@huanghuixin1 你的 activationEvents 没有声明,试试加个 |
加上了也不行,调整了一下格式如下 {
"name": "webext2",
"displayName": "webext2",
"description": "",
"version": "0.0.1",
"publisher": "hx",
"preview": true,
"engines": {
"kaitian": "*",
"vscode": "^1.31.1",
"node": ">=10.2.0"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"browser": "./dist/web/extension.js",
"contributes": {
"commands": [
{
"command": "webext2.helloWorld",
"title": "Hello World"
}
]
}
} |
@erha19 感谢回复 然后我看了下core项目中extension包,但我没找到入口js加载对应的逻辑在哪里 |
你插件有build过吗 加载插件的话 根据 package.json browser来加载插件js 确认下你插件下 有 ./dist/web/extension.js 这个吗 或者看下有没有加载的具体报错信息 |
@AhkunTa 肯定是build过的,而且就算没有也应该会有请求的记录报404,但实际的结果是没有请求。问题就出在没有报错信息。 并且我发现这个插件,就是官方提供的 |
@huanghuixin1 https://github.com/opensumi/core/blob/main/packages/extension/src/browser/extension-worker.service.ts#L66 这里是worker插件的初始化逻辑 可以debug看下这个插件在这里有没有初始化 很大概率是激活插件出了问题 |
已经加了browser字段,并且package.json是正常加载的,但是入口文件没有请求。
代码是参考vscode的webextension例子
package.json文件如下:
此时按F1运行
Hello Work
的cmd会报错然后看chrome的network是可以找到这个package.json的加载,但是找不到extension文件的加载
此外,有没有带入口js文件的webextension可以参考一下
The text was updated successfully, but these errors were encountered: