我是 chrome 扩展领域的初学者。目前我正在制作一个扩展,我想通过单击在扩展选项卡中打开一个新页面。所以这是我的 popup.html 代码
<html>
<head>
<title>Open Google</title>
</head>
<body>
<a href="https://google.com">Google</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
当我将其作为 html 页面打开时,google 链接正在工作,但这在我的扩展程序中不起作用。这是我的 manifest.json 文件
{
"manifest_version": 2,
"name": "Open Google",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"activeTab"
]
}
Run Code Online (Sandbox Code Playgroud) #include <stdio.h>
#include<string.h>
int main() {
char * a;
int b[26] = {
0
};
long r = 0;
scanf("%s", a);
int j = strlen(a);
for (int i = 0; i < j; i++) {
b[a[i] - 'a'] += 1;
}
for (int i = 0; i < 26; i++) {
if ((b[i] / 2) * 2 == b[i])
r += b[i] / 2;
else
r += (b[i] + 1) / 2;
}
printf("%ld", r);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输入 - …