Chrome 拡張機能を使う
5047 ワード
- 備忘録
sample
manifest.json
{
"name": "hoge",
"version": "0.0.1",
"manifest_version": 2,
"description": "Chrome Extensions Test.",
"content_scripts": [
{
"matches": ["http://xxx.xxx.xxx.xxx/chromeExt/*"],
"js": [
"scripts/jquery-3.2.1.min.js",
"scripts/main.js"
],
"run_at": "document_idle"
}
]
}
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Chrome Extensions Test</title>
</head>
<body>
<div id="main"></div>
</body>
</html>
scripts/main.js
$(function() {
var extHtml = '<input type="button" id="extBtn" value="Download">';
var main = $("#main");
main.append(extHtml);
$("#extBtn").on("click", function() {
console.log("extBtn clicked.");
});
});
参考リンク
Author And Source
この問題について(Chrome 拡張機能を使う), 我々は、より多くの情報をここで見つけました https://qiita.com/sireline/items/92ceec8a2e5300420b5c著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .