0
我有添加到YouTube頁面動態通過這個代碼的script.js文件:從動態添加腳本將消息發送給家長的Chrome擴展程序
var s = document.createElement('script');
s.src = chrome.extension.getURL('Script.js');
(document.head || document.documentElement).appendChild(s);
s.onload = function() {
s.parentNode.removeChild(s);
};
我有兩個問題:
1 - 我怎麼能將插入文件的消息發送到父項擴展。
2-我怎樣才能使從插入file..It的顯示錯誤消息的橫原點請求在控制檯
Origin http://www.youtube.com is not allowed by Access-Control-Allow-Origin.