chromeのnew tabを開いた際に、
googleの画像をyahooの画像に変えようと思い以下のプログラムを作成しました。
しかし、
以下のエラーが表示され、新しいtabを開いても画像が表示されません。
Uncaught (in promise) TypeError: Failed to fetch
optionmotors.com.hk/product_images/uploaded_images/yahoo_logo-620x168.png:1 GET http://optionmotors.com.hk/product_images/uploaded_images/yahoo_logo-620x168.png net::ERR_FAILED
javascript
1var timer = 0; 2var delay = 100; 3$(document).bind('DOMNodeInserted', function(event) { 4 if (timer) return; 5 var url="http://optionmotors.com.hk/product_images/uploaded_images/yahoo_logo-620x168.png"; 6 timer = setTimeout(function() { 7 $("#lga img").attr("src",url); 8 $("#logo-sub").empty(); 9 timer = 0; 10 }, delay); 11}); 12
json
1{ 2 "name": "new_tab_logo", 3 "version": "1.0.0", 4 "manifest_version": 2, 5 "description": "logoを変更する", 6 "content_scripts": [ 7 { 8 "matches": ["https://www.google.co.jp/*"], 9 "js": ["jquery.min.js","script.js"], 10 "run_at" :"document_start" 11 } 12 ], 13 "icons": { 14 "128": "img/icon_128.png", 15 "48": "img/icon_48.png", 16 "16": "img/icon_16.png" 17 }, 18 "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'" 19 }
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。