I'm trying to wrap my head around building a simple Chrome extension that replaces a certain tag's property on a webpage.
The site has the following code:
<body ondragstart="return false;" onselectstart="return false;">
thus making text on the web page unselectable. I'm trying to make the text selectable.
I tried this code in my script.js:
$(document).ready(function () {
$('body').live('selectstart dragstart', function (evt) {
evt.allowDefault();
return true;
});
});
and:
$(document).ready(function(){
var bd = document.getElementById('body');
bd.addEventListener('selectstart', start, true);
bd.addEventListener('dragstart', start, true);
});
My manifest is as follows:
{
"browser_action": {
"default_icon": "chav.jpg"
},
"content_scripts": [ {
"js": [ "jquery.js", "content_script.js" ],
"matches": [ "http://www.chavaramatrimony.com/*" ]
} ],
"description": "Lets you select text",
"icons": {
"128": "chav.jpg"
},
"manifest_version": 2,
"name": "ChavaraMatrimony Unlocker",
"update_url": "https://clients2.google.com/service/update2/crx",
"version": "1.1"
}
None of them seem to work. The console shows an error: "Uncaught TypeError: undefined is not a function".
I would be glad for some help on what I'm doing wrong going about this.