Commit 7c630e0f by chencong

修改测试文件

parent e72783de
icon.png

12.3 KB

icon2.png

500 Bytes

{
"name": "My First Extension",
"version": "2.0",
"manifest_version": 2,
"description": "知微舆情",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "out/popup.html"
},
"content_security_policy": "script-src 'self' https://jumpserver.irybd.com/chunk-vendors.chunk.js; object-src 'self'",
"background": {
"scripts": ["out/js/chunk-vendors.chunk.js","out/js/background.js"]
// "page": "out/background.html"
},
"externally_connectable": {
"matches": [
"http://news.baidu.com/*",
"https://www.baidu.com/*",
"http://www.baidu.com/*",
"http://weixin.sogou.com/*",
"https://weixin.sogou.com/*",
"http://wx.sogou.com/*",
"http://news.sogou.com/*",
"https://news.sogou.com/*",
"https://www.sogou.com/*",
"http://www.sogou.com/*",
"http://s.weibo.com/*",
"https://s.weibo.com/*",
"http://www.toutiao.com/search/*",
"https://www.toutiao.com/search*",
"https://www.toutiao.com/search/*",
"https://www.so.com/*",
"http://news.so.com/*",
"https://news.so.com/*",
"http://192.168.0.235/*",
"https://www.zhihu.com/search*",
"https://jumpserver.irybd.com/*"
]
},
"content_scripts": [
{
"matches": [
"http://news.baidu.com/*",
"https://www.baidu.com/*",
"http://www.baidu.com/*",
"http://weixin.sogou.com/*",
"https://weixin.sogou.com/*",
"http://wx.sogou.com/*",
"http://news.sogou.com/*",
"https://news.sogou.com/*",
"https://www.sogou.com/*",
"http://www.sogou.com/*",
"http://s.weibo.com/*",
"https://s.weibo.com/*",
"http://www.toutiao.com/search/*",
"https://www.toutiao.com/search*",
"https://www.toutiao.com/search/*",
"https://www.so.com/*",
"http://news.so.com/*",
"https://news.so.com/*",
"http://192.168.0.235/*",
"https://www.zhihu.com/search*"
],
"css": ["out/css/contentscript.css"],
"js": ["out/js/chunk-vendors.chunk.js","out/js/contentscript.js"],
"all_frames": true,
"run_at": "document_end"
}
],
"permissions": [
"notifications",
"webRequest",
"webRequestBlocking",
"notifications",
"proxy",
"management",
"contextMenus",
"tabs",
"storage",
"webRequest",
"webRequestBlocking",
"http://*/*",
"https://*/*"
]
}
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=UTF-8><title></title><link href=/out/js/background.js rel=preload as=script><link href=/out/js/chunk-vendors.chunk.js rel=preload as=script></head><body>sdfasdfasdfasdfasdfasdfasdfasdf asdfasdfjasdkflsadf<script src=/out/js/chunk-vendors.chunk.js></script><script src=/out/js/background.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=UTF-8><title>内容脚本</title><link href=/out/css/contentscript.css rel=preload as=style><link href=/out/js/chunk-vendors.chunk.js rel=preload as=script><link href=/out/js/contentscript.js rel=preload as=script><link href=/out/css/contentscript.css rel=stylesheet></head><body>内容脚本内容<script src=/out/js/chunk-vendors.chunk.js></script><script src=/out/js/contentscript.js></script></body></html>
\ No newline at end of file
.main_popup[data-v-d39105b4]{width:200px;height:100px}.index[data-v-d39105b4]{width:100%;height:100%;font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.index .switch[data-v-d39105b4]{display:inline-block;width:76px;height:36px;padding:3px;position:relative}.index .switch[data-v-d39105b4]:hover{cursor:pointer}.index .slide[data-v-d39105b4]{position:absolute;left:0;right:0;bottom:0;top:0;background:#ccc;border-radius:36px}.index .slide[data-v-d39105b4]:before{margin:3px;content:"OFF";display:inline-block;position:absolute;left:0;top:0;width:30px;height:30px;line-height:30px;text-align:center;background:#fff;border-radius:50%;-webkit-transition:all .3s linear;transition:all .3s linear;-webkit-box-shadow:2px 2px 2px rgba(0,0,0,.3);box-shadow:2px 2px 2px rgba(0,0,0,.3);font-size:12px}.index #switch:checked+.slide[data-v-d39105b4]{background:#2196f3}.index #switch:checked+.slide[data-v-d39105b4]:before{content:"ON";-webkit-transform:translate(40px);transform:translate(40px);-webkit-box-shadow:-2px 2px 2px rgba(0,0,0,.3);box-shadow:-2px 2px 2px rgba(0,0,0,.3)}
\ No newline at end of file
File added
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>cc</title>
</head>
<body>
<noscript>
<strong>We're sorry but cc doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
(function(t){function e(e){for(var n,c,i=e[0],s=e[1],u=e[2],f=0,d=[];f<i.length;f++)c=i[f],r[c]&&d.push(r[c][0]),r[c]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n]);l&&l(e);while(d.length)d.shift()();return a.push.apply(a,u||[]),o()}function o(){for(var t,e=0;e<a.length;e++){for(var o=a[e],n=!0,i=1;i<o.length;i++){var s=o[i];0!==r[s]&&(n=!1)}n&&(a.splice(e--,1),t=c(c.s=o[0]))}return t}var n={},r={background:0},a=[];function c(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,c),o.l=!0,o.exports}c.m=t,c.c=n,c.d=function(t,e,o){c.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},c.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},c.t=function(t,e){if(1&e&&(t=c(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(c.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)c.d(o,n,function(e){return t[e]}.bind(null,n));return o},c.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return c.d(e,"a",e),e},c.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},c.p="/out/";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],s=i.push.bind(i);i.push=e,i=i.slice();for(var u=0;u<i.length;u++)e(i[u]);var l=s;a.push([5,"chunk-vendors"]),o()})({5:function(t,e,o){t.exports=o("f728")},f728:function(t,e,o){"use strict";o.r(e);o("ac6a"),o("456d"),o("6762"),o("2fdb"),o("7514"),o("cadf"),o("551c"),o("f751"),o("097d");var n=o("7f43"),r=o.n(n);chrome.management.getAll(function(t){console.log(888);var e=t.find(function(t){return"知微舆情"===t.description}).id;console.log(e),chrome.storage.local.set({ExtensionID:e})}),r.a.defaults.withCredentials=!0,r.a.interceptors.response.use(function(t){if(console.log("添加响应拦截器",t),200!==t.status||!t.data||"插件版本过低,请升级"!==t.data.message)return t;chrome.notifications.create(Math.random()+"",{type:"basic",iconUrl:"images/icon_19.png",title:"通知",message:"插件版本过低,请升级"},function(t){console.log(t)})});var a=!0,c="http://yuqing.zhiweidata.com/qbjcbackPhoenix/",i="1561017600000";function s(t,e,o){if(console.log(t),console.log(o),"strong"===t.action){var n=t.data;return chrome.storage.local.get("configure",function(t){n.projectList=t.configure}),chrome.storage.local.get("project",function(t){n.project=t.project}),chrome.storage.local.get("user",function(t){n.user=t.user}),chrome.storage.local.get("rightStatue",function(t){Object.keys(t).length>0&&(n.rightStatue=t.rightStatue,o({data:n}))}),!0}if("SetStrong"===t.action)chrome.storage.local.set(t.data);else{if("getstrong"===t.action)return chrome.storage.local.get(t.data,function(t){console.log(t),o({data:t})}),!0;if("checkUpmark"===t.action){var a=t.params.project,s=null,u=null;return u="微博"===t.value[0].data.clientFrom?t.value.map(function(t){return{id:t.data.id,url:t.data.url,mark:!1,mid:t.data.mid,time:t.data.time}}):t.value.map(function(t){return{id:t.data.id,mark:!1,source:t.data.source,time:t.data.time,title:t.data.title,url:t.data.url}}),r.a.post("".concat(c,"interface/getDataMore/").concat(i,".do"),{company:a,mark:u,type:t.value[0].data.clientFrom},{headers:{time:(new Date).valueOf()}}).then(function(t){s=t.data,console.log(55555555555),o({data:s,tabProject:a})}).catch(function(t){console.log(t)}),!0}if("doingMark"===t.action)return r.a.post("".concat(c,"interface/markDataMoreBiz/").concat(i,".do"),t.value,{headers:{time:(new Date).valueOf()}}).then(function(t){var e=t.data;o({data:e})}).catch(function(t){console.log(t)}),!0;if("open"===t.action)chrome.browserAction.setIcon({path:"images/icon.png"});else{if("xhttp"===t.action)return r.a.get("".concat(c).concat(t.url,"/").concat(i,".do"),{params:t.params}).then(function(t){console.log(t),o({data:t.data})}).catch(function(t){console.log(t)}),!0;if("weiboxhttp"===t.action)return r.a.get("".concat(t.url)).then(function(t){console.log(t),o({data:t.data})}).catch(function(t){console.log(t)}),!0}}}function u(){r.a.get("".concat(c,"interface/getGroupInfo/").concat(i,".do")).then(function(t){chrome.storage.local.set({configure:t.data},function(){console.log("save success")})}).catch(function(t){console.log(t)})}document.addEventListener("DOMContentLoaded",function(){r()({url:"https://httpbin.org/ip",method:"GET"}).then(function(t){console.log(t.data.origin);var e=t.data.origin.includes("60.12.216.130");console.log(e);var o="\n\t var isInner = ".concat(e,"\n\t var direct = 'DIRECT;'\n\t var proxyinner = 'PROXY 192.168.0.36:31128'\n\t function FindProxyForURL(url, host) {\n\t if (shExpMatch(url, \"https:*weixin.sogou.com*\") && isInner){\n\t return proxyinner\n\t } else {\n\t return direct;\n\t }\n\t }\n\t "),n={value:{mode:"pac_script",pacScript:{data:o,mandatory:!0}},scope:"regular"};chrome.proxy.settings.set(n,function(){console.log("set success")})})}),chrome.runtime.onMessageExternal.addListener(function(t,e,o){return s(t,e,o),!0}),chrome.runtime.onMessage.addListener(function(t,e,o){return s(t,e,o),!0}),chrome.browserAction.setIcon({path:"images/icon.png"}),chrome.browserAction.onClicked.addListener(function(){a=!a,a?(chrome.browserAction.setIcon({path:"images/icon.png"}),chrome.storage.sync.set({isopen:!0})):(chrome.browserAction.setIcon({path:"images/icon2.png"}),chrome.storage.sync.set({isopen:!1}))}),chrome.contextMenus.create({title:"测试右键菜单",onclick:function(){alert("您点击了右键菜单!")}}),chrome.contextMenus.create({title:"使用度娘搜索:%s",contexts:["selection"],onclick:function(t){chrome.tabs.create({url:"https://www.baidu.com/s?ie=utf-8&wd="+encodeURI(t.selectionText)})}}),chrome.storage.local.get("configure",function(t){var e=t.configure;console.log("1234545487645"),console.log(e),e?console.log("has get defaultURL"):u()})}});
//# sourceMappingURL=background.js.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(function(e){function t(t){for(var r,c,u=t[0],l=t[1],a=t[2],p=0,f=[];p<u.length;p++)c=u[p],i[c]&&f.push(i[c][0]),i[c]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);s&&s(t);while(f.length)f.shift()();return o.push.apply(o,a||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,u=1;u<n.length;u++){var l=n[u];0!==i[l]&&(r=!1)}r&&(o.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},i={popup:0},o=[];function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/out/";var u=window["webpackJsonp"]=window["webpackJsonp"]||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var a=0;a<u.length;a++)t(u[a]);var s=l;o.push([1,"chunk-vendors"]),n()})({1:function(e,t,n){e.exports=n("7331")},7331:function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var r=n("2b0e"),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"main_popup"},[n("div",{staticClass:"index container"},[n("label",{staticClass:"switch",attrs:{for:"switch"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.switchPlugin,expression:"switchPlugin"}],attrs:{type:"checkbox",name:"zhiwei_plugin_switch",id:"switch",hidden:"","true-value":!0,"false-value":!1},domProps:{checked:Array.isArray(e.switchPlugin)?e._i(e.switchPlugin,null)>-1:e.switchPlugin},on:{change:function(t){var n=e.switchPlugin,r=t.target,i=!!r.checked;if(Array.isArray(n)){var o=null,c=e._i(n,o);r.checked?c<0&&(e.switchPlugin=n.concat([o])):c>-1&&(e.switchPlugin=n.slice(0,c).concat(n.slice(c+1)))}else e.switchPlugin=i}}}),n("span",{staticClass:"slide"})])])])},o=[],c={name:"popup",data:function(){return{switchPlugin:!0}},mounted:function(){var e=this;chrome.storage.local.get("pluginSwitch",function(t){t.hasOwnProperty("pluginSwitch")&&(e.switchPlugin=t.pluginSwitch)})},watch:{switchPlugin:function(e,t){console.log(1212121212),console.log(e);var n=chrome.storage.local;n.set({pluginSwitch:e})}}},u=c,l=(n("aef3"),n("2877")),a=Object(l["a"])(u,i,o,!1,null,"d39105b4",null),s=a.exports;r["a"].config.productionTip=!1,new r["a"]({el:"#popup",render:function(e){return e(s)}})},aef3:function(e,t,n){"use strict";var r=n("ee26"),i=n.n(r);i.a},ee26:function(e,t,n){}});
//# sourceMappingURL=popup.js.map
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=UTF-8><title>弹框</title><link href=/out/css/popup.css rel=preload as=style><link href=/out/js/chunk-vendors.chunk.js rel=preload as=script><link href=/out/js/popup.js rel=preload as=script><link href=/out/css/popup.css rel=stylesheet></head><body><div id=popup></div><script src=/out/js/chunk-vendors.chunk.js></script><script src=/out/js/popup.js></script></body></html><style></style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment