
Javascript
雨过天晴~
这个作者很懒,什么都没留下…
展开
-
contentscript同步和background通信
//contentscript同步和background通信//contentscriptvar url = location.origin+"/abcdefghijk/lmnopqrst/uvwxyz/contentscript";var xhr = new XMLHttpRequest();xhr.onreadystatechange=function(){ if(xhr.readyState==4){ if(xhr.status==200){ console.log(xhr.re.原创 2021-03-23 01:37:46 · 486 阅读 · 0 评论 -
chrome扩展设置代理
permissions 需要 "proxy" const pacScriptConfig = { mode: 'pac_script', pacScript: { data: `function FindProxyForURL(url, host) { if (host == "baidu.com" || host == "www.baidu.com") { return "PROXY 127.0.0.1:10809";//走本地v2r原创 2020-12-06 16:57:46 · 2602 阅读 · 0 评论 -
获取页面URL参数
function getQueryParameterByName(name) {name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),results = regex.exec(location.search);return results == null ? "" : decodeURIComponent(resu.原创 2020-11-05 22:46:56 · 172 阅读 · 0 评论 -
使用Jquery通过CSS选择器遍历处理HTML元素
/*getElementValues获取元素数组值 strOrObj可以是字符串或者对象 (1)字符串 - 必填,css选择器 (2)对象 { selector - 必填,css选择器 toJson - 选填,默认false } cb(node)函数 - 选填 参数说明: node - 元素Node 返回值说明: (1)return true; -> true -> 继续循环 (2)return false; -> fals.原创 2020-11-05 02:57:16 · 777 阅读 · 2 评论 -
Chrome 控制台 打印页面全局遍历 并 进行数据搜索,找到数据所在的全局变量
Chrome 控制台 打印页面全局遍历 并 进行数据搜索,找到数据所在的全局变量:for(var b in window) { if(window[b] && ((window[b] instanceof Array) || (window[b] instanceof Object) || (typeof(window[b])=='string'))) { console.log(window[b]); }}...原创 2020-11-04 00:28:56 · 1760 阅读 · 0 评论