我正在创建一个Chrome扩展程序,以通过链接在悬停鼠标上显示弹出窗口,它在网站示例中有效:
Https://example/office365_emails_email.com
但是当我转到这样的URL
Https://example/new.html#!/office365_emails_email.com 该扩展名不起作用,我认为是因为#,但我不知道如何解决
var links=document.getElementsByTagName('a');
for (var i=0;i<links.length;i++)
{
links[i].addEventListener('mouseover', readTheLink);
links[i].addEventListener('mouseout', removePopup);
}
function removePopup(e) {
popup.style.setProperty("display", "none", "important");
}
function readTheLink(element) {
//console.log(this.href)
if (this.href.indexOf('office365_emails_email')>-1)
manifest.json
"permissions": [
"activeTab",
"storage"
],
"background": {
"scripts": [ "background.js" ]
},
"content_scripts": [ {
"js": [
"jquery-3.4.1.slim.min.js",
"code.js"
],
"matches": [ "*://*/*" ],
"run_at": "document_end"
}
],
"options_ui": {
"chrome_style": false,
"open_in_tab": true,
"page": "newTabAPI.html"
},