[英]Javascript: get <img> src and set as return "" address?
function getFavicon(){
return "http://example.png"
}
This code is the only one that works for me.这段代码是唯一对我有用的代码。 When I try to change the url within that to a code like " return
"chrome.extension.getBackgroundPage().imageSrc[0]""
it shows nothing... can someone please help me?当我尝试将其中的 url 更改为诸如“ return
"chrome.extension.getBackgroundPage().imageSrc[0]""
它什么也没显示......有人可以帮我吗?
try this.尝试这个。
function backgroundFunction () {
return "http://example.png"
}
(function () {
var otherWindows = chrome.extension.getBackgroundPage();
console.log(otherWindows.backgroundFunction());
})();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.