gpt4 book ai didi

javascript - Chrome 扩展 : onclick() event is not triggering an alert() popup

转载 作者:行者123 更新时间:2023-11-29 10:18:43 24 4
gpt4 key购买 nike

<分区>

我无法使用 onclick() 事件触发 alert() 弹出窗口。

代码

文件 manifest.json

{
"name": "Project",
"version": "1.0.0",
"manifest_version": 2,
"description": "Popup when website requires Log in",
"browser_action":{
"default_icon":"icon_19.png",
"default_popup":"Popup.html"
}
}

文件 Popup.html

<html>
<head></head>

<body>
<div class="plus" onclick="popup()"></div>
<script src="inline.js"></script>
</body>
</html>

文件 inline.js

function popup() {
var link = document.URL;
alert("This is the link: (" + link + ")");
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com