每次打开新链接或"远离"点击它时,我都会失去如何使弹出窗口的添加内容不会消失.我已经阅读了有关内容脚本,后台脚本等的内容,但我并不知道如何将其实现到我自己的源代码中.下面是我的popup.html,popup.js和我的manifest.js文件.
{
"manifest_version": 2,
"name": "URL_save",
"description": "This extension saves an URL and renames the title to the user's wishes and hyperlink the title.",
"version": "0.1",
"browser_action": {
"default_icon": "/img/icon.png",
"default_popup": "popup.html",
"default_title": "See your saved websites!"
},
"permissions": [
"tabs"
]
}
Run Code Online (Sandbox Code Playgroud)
popup html:
<html>
<head>
<title>Your articles</title>
<link href="/css/style.css" rel="stylesheet"/>
<script src="/js/underscore-min.js"></script>
<script src="/js/popup.js"></script>
</head>
<body>
<div id="div">No content yet! Click the button to add the link of the current website!</div> …Run Code Online (Sandbox Code Playgroud) html javascript google-chrome google-chrome-extension firefox-addon-webextensions