自定义chrome useragent

chrome.runtime.sendMessage({
check: "UserAgent"
}, function(n) {
if (n.userAgent != "") {
var t = document.createElement("script");
t.type = "text/javascript";
t.text = "navigator.__defineGetter__('userAgent', function () { return '" + n.userAgent + "'; });";
document.getElementsByTagName("head")[0].appendChild(t);
}
});

posted @ 2017-04-02 07:26  哥,我还要  阅读(1840)  评论(0编辑  收藏  举报