I want to change the tab like edge://extensions/ or extension setting page title to add a '*' at the end of the original title if get the selection context on any page after mouseup event.
I create a simple Chrome extension.
change.js
var title = document.title;
document.addEventListener("selectionchange", function () {
if (!window.getSelection().toString().trim()) {
document.title = title;
}
});
document.addEventListener('mouseup', function (e) {
var text = window.getSelection().toString().trim();
if(text) {
document.title += '*';
} else if (!text) {
document.title = title;
}
});
The manifest.json file. It shows an error when I add it on the extension page.
Error: Invalid value for 'content_scripts[0].matches[0]': Invalid host wildcard.
{
"update_url": "https://example.com",
"name": "change",
"short_name": "change",
"description": "*",
"version": "1.0",
"icons": {
"16": "images/icon16.png",
"32": "images/icon32.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"content_scripts": [
{
"matches": ["*://*/*"],
"js": ["change.js"]
}
],
"manifest_version": 2
}