when video changed page dosen't load it just show a red line and content.js dosen't load
content.js
var btn = document.createElement("input");
var btn2 = document.createElement("input");
btn.type = 'button';
btn.value = 'Download Video';
btn.id = 'submit';
btn.name = 'submit';
btn.href = "#"
btn.class = "Submit"
btn2.type = 'button';
btn2.value = 'Download Video';
btn2.id = 'submit2';
btn2.name = 'submit2';
btn2.href = "#"
btn2.class = "Submit2"
btn.onclick = function (tab) {
var Title = document.getElementById("eow-title").getAttribute("title");
alert(Title);
return false;
};
var st2 = btn2.style;
st2.cursor = "pointer";
st2.top = "-16px";
st2.left = "325px";
st2.position = 'absolute';
var st = btn.style;
st.cursor = "pointer";
st.top = "18px";
st.left = "325px";
st.position = 'absolute';
document.getElementById("watch7-user-header").appendChild(btn);
document.getElementById("watch7-user-header").appendChild(btn2);
manifest.jason
{"name": "YouTube Downloader",
"version": "0.1",
"manifest_version": 2,
"description": "YouTube Downloader",
"offline_enabled": true,
"content_scripts": [{
"matches": ["*://*/*"],
"js": ["content.js"],
"css": ["style.css"],
"run_at": "document_end",
"all_frames": false
}],
"icons": {"16": "icon16.png", "128": "icon128.png"},
"browser_action": {
"default_popup": "popup.html",
"default_icon": "icon16.png",
"default_title": "YouTube Downloader"},
"background": {"persistent": false, "scripts": ["background.js"]},
"default_locale": "en",
"permissions": ["contextMenus", "downloads", "downloads.open","tabs"],
"web_accessible_resources": [
"style.css"
]}