I'm not familiar with JavaScript.
I wrote an extension myself, but it didn't work.
The extended function is very simple, that is to activate the onselectstart
parameter, because this parameter in the web page makes it impossible to select the text of the web page and then copy it. If I activate this parameter, I can select and copy.
I can execute this JavaScript command directly in the chrome console, and enable the onselectstart
, works well:
document.body.onselectstart = function(){return true;};
but it will not take effect after put it into the extension.
My extension is very simple, just two files:
manifest.json
:
{
"manifest_version": 2,
"name": "Copy unblocker",
"version": "1.0",
"description": "enable onselectstart",
"icons": { "16": "images/logo.png" },
"permissions": [
"activeTab"
],
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["js/content_script.js"]
}
]
}
content_ script.js
:
document.body.onselectstart= function(){
return true;
}
What's wrong, or can you give me an chrome extension script that can change the onselectstart
parameter?
The web page is generated by JS. This parameter prevents me from selecting text