├── .github └── workflows │ └── sync-to-gitlab.yml ├── .gitignore ├── README.md ├── adg_emCupid.txt ├── block_Baiduunion.user.js ├── hack_plus.user.js └── hack_plus_new.user.js /.github/workflows/sync-to-gitlab.yml: -------------------------------------------------------------------------------- 1 | name: SyncToGitlab 2 | 3 | on: 4 | push: 5 | branches: ["master"] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Github Sync to Gitlab 13 | uses: wearerequired/git-mirror-action@master 14 | env: 15 | SSH_PRIVATE_KEY: ${{ secrets.GITLAB_ED25519_PRIVATE_KEY }} 16 | with: 17 | source-repo: git@github.com:emCupid/adg_cn.git 18 | destination-repo: git@gitlab.com:emCupid/adg_cn.git -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | hide_css_plus.user.js 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 仓库: 2 | https://gitlab.com/emCupid/adg_cn.git 3 | https://github.com/emCupid/adg_cn 4 | https://emcupid.coding.net/public/adg_cn/adg_cn/git 5 | 6 | 7 | ## 规则: 8 | Gitlab:[https://gitlab.com/emCupid/adg_cn/-/raw/master/adg_emCupid.txt](https://subscribe.adblockplus.org/?location=https://gitlab.com/emCupid/adg_cn/-/raw/master/adg_emCupid.txt "adg_emCupid") 9 | GitHub:[https://raw.githubusercontent.com/emCupid/adg_cn/master/adg_emCupid.txt](https://subscribe.adblockplus.org/?location=https://raw.githubusercontent.com/emCupid/adg_cn/master/adg_emCupid.txt "adg_emCupid") 10 | jsDelivr:[https://cdn.jsdelivr.net/gh/emCupid/adg_cn/adg_emCupid.txt](https://subscribe.adblockplus.org/?location=https://cdn.jsdelivr.net/gh/emCupid/adg_cn/adg_emCupid.txt "adg_emCupid") 11 | 12 | ## 脚本: 13 | 【**朝朝暮暮plus**】一些浏览器增强功能及辅助移除广告 14 | GitLab:https://gitlab.com/emCupid/adg_cn/-/raw/master/hack_plus.user.js 15 | GitHub:https://github.com/emCupid/adg_cn/raw/master/hack_plus.user.js 16 | jsDelivr:https://cdn.jsdelivr.net/gh/emCupid/adg_cn/hack_plus.user.js 17 | 测试联盟广告:http://www.wuhan.com/xinwen/68537.html 18 | 测试iframe类的横幅:https://www.xbiquge.la/10/10489/ 19 | 测试阻止script write:https://www.hao6v.tv/ 20 | 解除限制(右键、选择、复制、尾巴等):http://www.360doc.com/content/18/0731/18/30583588_774726606.shtml 21 | 22 | ## PS: 23 | * 反馈QQ群:[240088290](https://jq.qq.com/?_wv=1027&k=Nn7JsKsm) 24 | * GitLab、GitHub、jsDelivr镜像自行测试访问速度三选一 25 | * jsDelivr节点多,速度快,但是会有缓存(24小时),所以文件可能不是最新 26 | * 朝朝暮暮plus脚本因为ADG当前稳定版(7.6.1)GM_setValue有BUG导致不能储存设置,如果想正常使用请更新到7.7 Beta 1以上 27 | * 代理横式下无法保存设置揭示adguard-ws-api报错在host下添加一条【176.103.133.77 adguard-ws-api】即可解决(不含【】) 28 | * coding RAW不能直接访问了,请更换github或gitlab的订阅地址 -------------------------------------------------------------------------------- /adg_emCupid.txt: -------------------------------------------------------------------------------- 1 | ! Title: ADG_emCupid 2 | ! Description: 只对于AdGrard中文过滤器、EasyList中国补充(仅PC,移动端未测试),adg home不适用绝大部分规则 3 | ! TimeUpdated: 2024-01-30T22:51:45+08:00 4 | 5 | !-------全局&正则------- 6 | ~aliyundrive.com,~qq.com##div[style*="z-index"][style*="99999"] iframe 7 | ##a[href*="@"][href*="_"][href*="exe"],a.gaosu,#down_gs,.gs_box 8 | ##.title>.qq>a,ul.stui-vodlist>li:not(:has(.stui-vodlist__thumb[href^="/"])):has(.stui-vodlist__detail>h4) 9 | ||*@*_*.exe$redirect=empty 10 | ||*_*@*.exe$redirect=empty 11 | /\/ads\/\.*?\d*.*?\.js/$script 12 | /\/ad\/\d+\.js/$script 13 | 14 | !-------白名单------- 15 | @@||lts*.qq.com^*.ts?index=$media,domain=qq.com 16 | @@||192.168.*.*$important 17 | @@192.168.*.* 18 | @@||stats.g.doubleclick.net^$domain=netlify.com 19 | @@||zhihu.com/api/*/oauth/captcha/ 20 | 21 | !-------乐视播放广告------- 22 | le.com#%#//scriptlet("set-constant", "isAdLoaded", "true") 23 | le.com#%#//scriptlet("set-constant", "Object.prototype.noAD", "true") 24 | !-------爱奇艺播放广告------- 25 | ||iqiyi.com/v_*.html$replace=/"[^"]+?\.(f4v|mp4)"/""/ 26 | !#if (adguard_app_windows) 27 | iqiyi.com#@%#//scriptlet("set-constant", "Object.prototype.parseXML", "noopFunc") 28 | !#endif 29 | !||cupid.iqiyi.com/mixer 30 | ||iqiyi.com/show2?$replace=/"cr":\{/"cr":\{\}\,"noad":\{/ 31 | ||iqiyi.com/show2?$replace=/("\w*?":")\d+?"\,/\$1"\,/ 32 | ||iqiyi.com/show2?$replace=/"[^"]+?\.(jpg|png|swf)"/""/ 33 | !-------腾讯播放广告------- 34 | ||vm.gtimg.cn/c/*/tencentvideo/txpv*$replace=/\w\.ad\)/{"adGetv":{}})/ 35 | ||l.qq.com/*get_video_mark_all*$replace=/"admark"/"admark":{}\,"noad"/ 36 | !-------优酷播放广告------- 37 | ||yk-*.ad.youku.com$redirect-rule=1x1.gif,from=youku.com 38 | youku.com#%#//scriptlet("set-constant", "Object.prototype._playlistData.ad", "null") 39 | ||acs.youku.com/h5/$replace=/"ad"/"ad":{}\,"noad"/ 40 | ||acs.youku.com/h5/$replace=/"watermark"/"nowatermark"/ 41 | ||acs.youku.com/h5/$replace=/"ykad"/"ykad":{}\,"noykad"/ 42 | !-------主流视频去水印------- 43 | ixigua.com##.common-xgplayer__Logo 44 | iqiyi.com#$?#.iqp-logo-box{ remove: true; } 45 | v.youku.com#?#.kui-watermark-logo-layer 46 | v.qq.com#$?#.txp-watermark{ remove: true; } 47 | live.bilibili.com#$?#.web-player-icon-roomStatus{ remove: true; } 48 | #?#.dplayer-logo,.yzmplayer-logo 49 | 50 | !-------追踪&统计------- 51 | ||beacon.qq.com/analytics/$replace=/^.*$/{"msg": "success"}/ 52 | ||beacon.sina.com.cn^ 53 | ||s.union.360.cn/s.gif 54 | ||www.webdissector.com/recv/gs.gif 55 | ||www.douban.com/stat.html 56 | ||webterren.com/webdig.js 57 | ||webstat.ws.126.net/stat/? 58 | ||synacast.com/1.html 59 | ||stat.funshion.com/ 60 | ||sbeacon.sina.com.cn/mrt.gif? 61 | ||s.qhupdate.com/sou/home.gif? 62 | ||s.360.cn/*/s.htm? 63 | ||m.wrating.com/m.gif 64 | ||log^.mtime.cn/_t.gif 65 | ||log.qianzhan.com^ 66 | ||irs01.net^ 67 | ||idm.bce.baidu.com/t/ping.gif 68 | ||gridsumdissector.com/gs.gif? 69 | ||fundin.douban.com/piwik? 70 | ||emw927.com/count? 71 | ||ef-dongfeng.tanx.com/tanx? 72 | ||apstat.js?url= 73 | ||365dmp.com/*? 74 | ||*/logger.js 75 | ||*/index/q.php?cid= 76 | ||*/js/count.js 77 | ||*/baidu_tongji.js 78 | ||hm.baidu.com^ 79 | ||zz.bdstatic.com/linksubmit/push.js 80 | ||sbeacon.sina.com.cn/e.gif 81 | ||rs.sinajs.cn/*.gif? 82 | ||51.la^ 83 | 84 | !-------规则------ 85 | 86 | ! 度盘AD 87 | https://pan.baidu.com/*conf_key=business_ad 88 | ||bdstatic.com/business-static/*/businessAd 89 | https://pan.baidu.com/ndbs/nd_bundle*.js 90 | pan.baidu.com#%#//scriptlet('prevent-setTimeout', 'message') 91 | pan.baidu.com#$#.init-new-content{width:100%!important} 92 | https://pan.baidu.com/*/pcs/adx 93 | 94 | 123pan.com##.banner-container-pc 95 | ||58cdn.com.cn/git/wuxianfe/pc-static/*/doneA_*.js 96 | 58.com###bottomBanner,.job_item:has(.hr),.job_item:has(.job_ad_tips) 97 | ||iqiyipic.com/gaze/pcw/ssr*/$replace=/this.hasJumpType/1/ 98 | ||iqiyi.com/player*/display/control 99 | iqiyi.com#%#//scriptlet('prevent-setTimeout', '/\.promotionShow/') 100 | dataaps.com#%#//scriptlet('prevent-window-open') 101 | btnull.*#%#//scriptlet('set-local-storage-item', 'lyad', '1') 102 | btnull.*#%#//scriptlet('set-local-storage-item', 'adset', '1') 103 | greasyfork.org##.post-install 104 | ctfile.com#%#//scriptlet('set-constant', '_popup_ispoped','true') 105 | ||myqcloud.com/app/gif/*.gif 106 | bdys01.com#%#//scriptlet('abort-on-property-read', 'alert') 107 | ||gmtv1.*$redirect=nooptext 108 | nivodi.tv##.st-btn,img.pca-img,#copytoshareAlert,#bg_cover 109 | subaibaiys.com#%#//scriptlet('set-cookie', 'myannoun', '1') 110 | 111 | !18+ 112 | 126728.net###playerdavLayer,.da, .listview, .narrow, .sortable 113 | https://theav101.com/player/m3key.php$replace=/\?segments=\d*?&time=\d*?'/'/ 114 | theav101.com##+js(set, PlayerjsEvents, noopFunc) 115 | theav101.com##.green,.choice_list,.openwin 116 | theav101.com#$#.player{width:70%;height:70%;left:15% !important} 117 | 88lou.cc##.navbar-item[target="_blank"],.q-loading-bar 118 | /static/jshtml/domain.change.dialog.js 119 | /*.gif$domain=88lou.cc,av411.xyz 120 | 88lou.cc,tp102.com,weav.xyz#?#.q-img,.gg-config,.toolbar-gg,#vip_only 121 | 88lou.cc,tp102.com,weav.xyz#%#//scriptlet("set-constant", "avshow.video_playr_sider", "null") 122 | 88lou.cc,tp102.com,weav.xyz#%#//scriptlet("set-constant", "avshow.user.is_vip", "true") 123 | 88lou.cc,tp102.com,weav.xyz#%#//scriptlet("set-constant", "av_response.vip", "null") 124 | 88lou.cc,tp102.com,weav.xyz#%#//scriptlet("set-constant", "avshow.config.ads", "null") 125 | 88lou.cc,tp102.com,weav.xyz#%#//scriptlet("set-constant", "avshow.config.ads_object", "null") 126 | porncvd.com##h5, h5 + div 127 | porncvd.com#%#sessionStorage.setItem('token', 'Tom'); 128 | ||porncvd.com/poweredby-test 129 | ||*/common/getAdList 130 | #$?##app{overflow-x:visible!important;} 131 | ||hxc-api.com/home/getAds 132 | avgle.com###ps32-container 133 | javdb.com##.app-desktop-banner,.moj-content 134 | /api/*/ad?type= 135 | /ckplayer/ad.json 136 | |http://*/e/DownSys/play/$replace=/advertisements:'.*?'\,// 137 | /gghtml/* 138 | /d/file/huandeng/* 139 | ||*/static/extra/ad.js 140 | ||apple1818.net^ 141 | ||missav.com/*.gif 142 | missav.com$$a[rel="sponsored"] 143 | missav.com##.lg\:block 144 | missav.com#%#//scriptlet('prevent-window-open') 145 | missav.com#%#//scriptlet('prevent-addEventListener','visibilitychange') 146 | missav.com#%#//scriptlet('prevent-addEventListener','blur') 147 | 148 | iqiyi.com##.detail-sd 149 | 51miz.com##.banner-warp,.rise-price-use-now 150 | 58pic.com##.activitySettings-fixedBottom,.slider-gg-banner-row,#new-user-dialog,body>div[id^="activity"][style*="block"],.search-v3-content>div[style*="fixed"],.header-renewal,.index-move-modal,.market-dialog-model,#double-dan 151 | www.58pic.com#?#.search_poster:has(.is-advertisement) 152 | 588ku.com##.advertF,#rightAdEditor,.editIndex-entry.editIndexEntry,.adfix-box,.showinfo-ad,.filter-listadBtm-box,.kouIndex-entry,.listhorAdV 153 | ibaotu.com##[ibaotu-md-value*="_ad"],[class*="-ad"]:not(li),.upgrade-comVip,[class*="qyvip"],.qy-Redenvelope,.AdverBanner,.nationalRed-wrap,.float-upgrade,.searchAdver,.divQRalert,.index-ope-pop,.TryOut-PopUps,.TryOut-Bottom,[class^="question"],[ibaotu-md-value="zhjgy_dbggw"],.enterprise-domination,.combo-fulldown-box,.enterprise-home-domination,a.vip-qy-download-button,.qy-enterprise-init 154 | huaban.com##[class*="pin-view"] a[href*="utm_source="],[id*="-ad-"] 155 | jianshu.com##[aria-label*="-ad"],.aside>div:contains(抽奖),#menu>div:contains(抽奖) 156 | jianshu.com#?#div:has(>div[aria-label*="抽奖"]),div:has(div[tabindex="-1"][role="dialog"]) 157 | www.dianping.com##.bottomLayer,.J-bonus,.bottomLayer 158 | www.qiuziti.com##.font-item-box[style*="position"],.banner.home-banner,.font-download-banner 159 | 360kuai.com##.kzx__showcase 160 | nipic.com##div[onclick="printgif()"],.huitu-guideBox,.homeshow,.insertbdad-wrap,#ad,.advertising 161 | image.so.com##[data-id^="cm_display"],[data-id*="JumpAds"] 162 | pan.baidu.com##.phone-banner 163 | ||statics.woozooo.com/img/p* 164 | ||*/js/bind-phone-modal.ad* 165 | huaban.com##div[class*="hb-ad"] 166 | ||ntimg.cn/*_ad.jpg 167 | toutiao.com##div[class$="-mode"] :has(a.ad) 168 | !www.epinv.com#?#.epinv_f,.footbar,.adsbygoogle 169 | !||epinv.com$redirect=empty 170 | youku.com##[data-adtype],[data-adpid],[data-adext] 171 | youku.com#?#.swiper-slide:has([data-intactspm*="yk_ad_"]) 172 | qq.com##txpdiv[data-role^="hd-ad-adapter-"] 173 | www.sohu.com##div.clear[data-spm-content]:matches-attr("data-spm-content"="/.{200}.*/") 174 | www.sohu.com##div.allsee-item[id$="_"]:has(a[id]) 175 | szhk.com##div.mt10:has(span.banner_gg) 176 | gucheng.com#?#.ask_topad,[class^="ask_daad"],.fenye_my_pc,.title_ad,div[class*="_gg_"],#adDiv,div[class*="_xxl_"],.right_info_pc,div.right_img>div:has(iframe),.left_list_pc>div:has(iframe) 177 | sina.com.cn#?#div[class]:matches-attr("/data-/"="/ad_content/") 178 | tv.sohu.com/s/sohuplayer/*$replace=/<\/html>/'; 435 | } else if (!text) { 436 | Fuck_Tooltip.style.display = 'none'; 437 | } 438 | }) 439 | })(); -------------------------------------------------------------------------------- /hack_plus_new.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 朝朝暮暮plus_new 3 | // @version 1.28.0001 4 | // @author 汝莫舞 5 | // @description 一些浏览器增强功能及辅助移除广告【Ctrl+↑脚本设置】 6 | // @homepageURL https://github.com/emCupid/adg_cn 7 | // @match *://*/* 8 | // @namespace emCupid 9 | // @updateURL https://cdn.jsdelivr.net/gh/emCupid/adg_cn/hack_plus_new.user.js 10 | // @grant unsafeWindow 11 | // @grant GM_setValue 12 | // @grant GM_getValue 13 | // @grant GM_listValues 14 | // @grant GM_deleteValue 15 | // @run-at document-start 16 | // @require http://code.jquery.com/jquery-3.x-git.min.js 17 | // @exclude *://*.taobao.com* 18 | // @exclude *://*.tmall.com* 19 | // @exclude *://*.1688.com* 20 | // @exclude *://*.jd.com* 21 | // @exclude *://*.suning.com* 22 | // @exclude *://*.dangdang.com* 23 | // @exclude *://*.mogu.com* 24 | // @exclude *://graph.baidu.com/*similar* 25 | // ==/UserScript== 26 | 27 | //功能模块定义 28 | (function (){ 29 | var key = ("mh_" + Math.random()); 30 | var keyR = new RegExp(("(^|;)\\s*" + key + "=12345")); 31 | var expiredTime = new Date(0); 32 | var domain = document.domain; 33 | var domainList = domain.split('.'); 34 | var urlItems = []; 35 | urlItems.unshift(domainList.pop()); 36 | while (domainList.length) { 37 | urlItems.unshift(domainList.pop()); 38 | var mainHost = urlItems.join('.'); 39 | var cookie = (key + "=" + 12345 + ";domain=." + mainHost); 40 | document.cookie = cookie; 41 | if (keyR.test(document.cookie)) { 42 | document.cookie = (cookie + ";expires=" + expiredTime); 43 | return window['_getMainHost'] = mainHost; 44 | } 45 | } 46 | })(); 47 | 48 | var localStorage = { 49 | getItem : function (name, defaultValue) { 50 | return GM_getValue(name, defaultValue) 51 | }, 52 | setItem : function (name, value) { 53 | return GM_setValue(name, value) 54 | }, 55 | removeItem : function (name) { 56 | return GM_deleteValue(name) 57 | }, 58 | listItem : function () { 59 | return GM_listValues() 60 | } 61 | }; 62 | //debug GM_Value 63 | unsafeWindow.__$get = GM_getValue; 64 | unsafeWindow.__$set = GM_setValue; 65 | unsafeWindow.__$delete = GM_deleteValue; 66 | unsafeWindow.__$list = GM_listValues; 67 | 68 | function checkbox_onClick(checkbox) { 69 | if (checkbox.checked) { 70 | hackplus_whitelist[checkbox.id] = 1; 71 | } else { 72 | delete hackplus_whitelist[checkbox.id]; 73 | } 74 | localStorage.setItem("$" + getDoamin + "$", JSON.stringify(hackplus_whitelist)); 75 | } 76 | 77 | function AddTempHide(Item) { 78 | var tempHideItem = Item.tagName + "[src='" + Item.src + "']"; 79 | if(tempHide.indexOf(tempHideItem) == -1) { 80 | try{ 81 | tempHide.push(tempHideItem) 82 | } catch(e){ 83 | tempHide = tempHide.split(","); 84 | tempHide.push(tempHideItem) 85 | } finally { 86 | sessionStorage.setItem("Fuck_Hide",tempHide) 87 | } 88 | } 89 | } 90 | 91 | function Fuck_removeAD(Item, MinWidth, MaxWidth, MinHeight, MaxHeight, RmoveFun, Color) { 92 | var txtColor = Color || "#E20", 93 | logCss = 'border-left:' + txtColor + ' 5px solid;color:' + txtColor + ';padding:3px'; 94 | //&& Item.offsetLeft > 0 95 | if ((Item.offsetWidth >= MinWidth && Item.offsetWidth <= MaxWidth && Item.offsetHeight >= MinHeight && Item.offsetHeight <= MaxHeight) || (Item.naturalWidth >= MinWidth && Item.naturalWidth <= MaxWidth && Item.naturalHeight >= MinHeight && Item.naturalHeight <= MaxHeight)) { 96 | //Item.src = Item.src || Item.outerHTML.match(/^<.*?>/); 97 | switch (RmoveFun) { 98 | case 1: 99 | Item.parentNode.removeChild(Item); 100 | console.log('%c[Remove AD] ✂%o', logCss, Item.src || Item); 101 | break; 102 | case 2: 103 | AddTempHide(Item); 104 | Item.parentNode.parentNode.removeChild(Item.parentNode); 105 | console.log('%c[Remove AD] ✂%o', logCss, Item.src || Item); 106 | break; 107 | } 108 | }else if((Item.offsetWidth > 500 && Item.offsetHeight) || (Item.naturalWidth > 500 && Item.naturalHeight)){ 109 | //console.log('%c[log offset] ✂%O',logCss,'offsetWidth:' ,Item.offsetWidth||Item.naturalWidth,'offsetHeight:',Item.offsetHeight||Item.naturalHeight ,Item.src || Item); 110 | } 111 | } 112 | var getDoamin = window._getMainHost || window.location.host, 113 | MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, 114 | hackplus_whitelistJSON = localStorage.getItem("$" + getDoamin + "$") || "{}", 115 | hackplus_whitelistJSON_temp = localStorage.getItem("$" + getDoamin + "$") || "{}", 116 | hackplus_whitelist = JSON.parse(hackplus_whitelistJSON), 117 | tempHide = sessionStorage.getItem("Fuck_Hide") || ["emCupid"], 118 | tempCssStyle = tempHide + "{position:absolute!important;left:-5000px;width:1000px;height:100px}", 119 | tempCssXML = document.createProcessingInstruction("xml-stylesheet", 'type="text/css" href="data:text/css,' + encodeURIComponent(tempCssStyle) + '"'), 120 | iframeSRC_whitelist = [ 121 | 'm3u8', 122 | 'MacPlayer', 123 | 'upload', 124 | 'player', 125 | 'comment', 126 | 'jiexi.php', 127 | '\\/soft', 128 | '\\/login', 129 | 'vip\\.php\\?url=', 130 | '\\/vip\\/index\\.php\\?url=', 131 | '\\/index\\.php\\?url=https?:\\/\\/', 132 | 'lanzou..com\\/fn\\?', 133 | '.china.com.cn\\/node_', 134 | '\\/\\/.+?\\.douyu\\.com', 135 | '\\/\\/v.qq.com', 136 | '\\/\\/tushuo.baidu.com', 137 | '\\/\\/zhannei.baidu.com', 138 | '\\/\\/widget.weibo.com' 139 | ], 140 | iframeSRC = new RegExp(iframeSRC_whitelist.join("|","i")), 141 | scriptWRS_blacklist = [ 142 | 'script.*src=', 143 | '\\/click\\/', 144 | 'var hm ?= ?document\\.createElement', 145 | 'cpro_id', 146 | 'tanx-a-mm' 147 | ], 148 | scriptWRS_B = new RegExp(scriptWRS_blacklist.join("|","i")), 149 | scriptWRS_whitelist = [ 150 | 'm3u8', 151 | 'MacPlayer', 152 | '[\\u4e00-\\u9fa5]', 153 | 'player', 154 | 'editor\\/', 155 | 'map.baidu.com', 156 | '\\/api', 157 | 'cityjson', 158 | '\\/conf', 159 | 'qhcs.css', 160 | 'qhcs.js', 161 | 'data.video.iqiyi.com\\/v.mp4', 162 | 'account\\.', 163 | 'letvcdn.com', 164 | 'jquery', 165 | 'swfobject', 166 | 'toolbar', 167 | 'lightbox', 168 | 'login', 169 | 'comment', 170 | 'all_async_search', 171 | 'psp_jump_white_list', 172 | 'bd_share', 173 | 'document.write', 174 | 'hdslide', 175 | 'ifengimg.com', 176 | '\\/pc\\/js\\/down.js', 177 | '\\/xinwen', 178 | '\\/video\\/', 179 | '\\/vip\\/', 180 | '\\/data\\/da_default.js', 181 | 'BackTop' 182 | ], 183 | scriptWRS_W = new RegExp(scriptWRS_whitelist.join("|","i")), 184 | push_error = function (e) { 185 | return function () { 186 | console.error("Block " + e + " push Ad(s)") 187 | } 188 | }; 189 | if (hackplus_whitelistJSON == "{}") { 190 | localStorage.removeItem("$" + getDoamin + "$") 191 | } 192 | //功能模块定义[end] 193 | 194 | 195 | function Fuck_ADV(){ 196 | [].forEach.call(document.querySelectorAll('[class*="img"][style*="background-image"],a[target] img:not([src*="avatar"]),a[style] img:not([src*="avatar"]),a[onclick] img:not([src*="avatar"]),a[href*="javascript"] img:not([src*="avatar"]),a[rel*="nofollow"] img:not([src*="avatar"]),a img[style*="display"][style*="block"],a:not([href*="' + getDoamin.split('.')[0] + '."]):not([href^="/"]) img'), function (Nodeitem) { 197 | Fuck_removeAD(Nodeitem, 570, 1800, 40, 160, 2); 198 | Fuck_removeAD(Nodeitem, 350, 400, 35, 150, 2);//手机缩放兼容 199 | Fuck_removeAD(Nodeitem, 40, 150, 300, 650, 2, "#08E") 200 | }); 201 | [].forEach.call(document.querySelectorAll('img[data-link]'), function (Nodeitem) { 202 | Fuck_removeAD(Nodeitem, 579, 1800, 40, 150, 3); 203 | }); 204 | [].forEach.call(document.querySelectorAll('a[target*="/?channelCode"] img,a[href*=":1"] img,a[href*=":2"] img,a[href*=":3"] img,a[href*=":4"] img,a[href*=":5"] img,a[href*=":6"] img,a[href*=":7"] img,a[href*=":8"] img,a[href*=":9"] img'), function (Nodeitem) { 205 | Fuck_removeAD(Nodeitem, 579, 1800, 40, 190, 3); 206 | }); 207 | [].forEach.call(document.getElementsByTagName('iframe'), function (Nodeitem) { 208 | if (!iframeSRC.test(Nodeitem.src) && Nodeitem.getAttribute("src") && Nodeitem.offsetWidth >= 600 && Nodeitem.offsetWidth <= 1500 && Nodeitem.offsetHeight >= 40 && Nodeitem.offsetHeight <= 180) { 209 | Nodeitem.parentNode.removeChild(Nodeitem); 210 | console.log('%c[Remove ADiframe] ✂%O', 'border-left:5px solid #0B0;color:#0B0;padding:3px', Nodeitem, Nodeitem.src); 211 | } 212 | }); 213 | } 214 | 215 | function Fuck_UNION(){ 216 | unsafeWindow._SF_ = []; 217 | unsafeWindow._SF_._global_ = []; 218 | unsafeWindow._SF_._global_._ssp = []; 219 | Object.freeze(unsafeWindow._SF_); 220 | Object.freeze(unsafeWindow._SF_._global_); 221 | Object.freeze(unsafeWindow._SF_._global_._ssp); 222 | unsafeWindow._ssp_global = []; 223 | Object.freeze(unsafeWindow._ssp_global); 224 | unsafeWindow.AD = {}; 225 | Object.freeze(unsafeWindow.AD); 226 | unsafeWindow.Ad = {}; 227 | Object.freeze(unsafeWindow.Ad); 228 | unsafeWindow.ad = {}; 229 | Object.freeze(unsafeWindow.ad); 230 | unsafeWindow.___baidu_union_ = {} 231 | Object.freeze(unsafeWindow.___baidu_union_) 232 | unsafeWindow.___baidu_union_ds_ = {}; 233 | Object.freeze(unsafeWindow.___baidu_union_ds_); 234 | unsafeWindow.__delivery_global_ = {}; 235 | Object.freeze(unsafeWindow.__delivery_global_) 236 | unsafeWindow.___delivery___global___counter___ = {}; 237 | Object.freeze(unsafeWindow.___delivery___global___counter___); 238 | unsafeWindow.cproArray = {}; 239 | unsafeWindow.cproArray.push = push_error("Baidu"); 240 | Object.freeze(cproArray); 241 | unsafeWindow.arrBaiduAds = {}; 242 | unsafeWindow.arrBaiduAds.push = push_error("Baidu"); 243 | Object.freeze(arrBaiduAds); 244 | unsafeWindow.slotbydup = {}; 245 | unsafeWindow.slotbydup.push = push_error("Baidu SSP"); 246 | unsafeWindow._qha_data = {}; 247 | Object.freeze(unsafeWindow._qha_data); 248 | unsafeWindow.sinaads = {}; 249 | unsafeWindow.sinaads.push = push_error("Sina"); 250 | Object.freeze(unsafeWindow.sinaads); 251 | unsafeWindow.sogou_un = {}; 252 | Object.freeze(unsafeWindow.sogou_un) 253 | } 254 | 255 | function Fuck_WRS() { 256 | document.Rwrite = document.write; 257 | document.write = function (str) { 258 | if (scriptWRS_W.test(str)) { 259 | document.Rwrite(str); 260 | } else { 261 | console.log('%c[Block Script Write] ✂', 'border-left:5px solid #A0B;color:#A0B;padding:3px', str); 262 | } 263 | }; 264 | document.Rwriteln = document.writeln; 265 | document.writeln = function (str) { 266 | if (scriptWRS_W.test(str)) { 267 | document.Rwriteln(str); 268 | } else { 269 | console.log('%c[Block Script Writeln] ✂', 'border-left:5px solid #A0B;color:#A0B;padding:3px', str); 270 | } 271 | }; 272 | } 273 | 274 | function Fuck_XZ(event) { 275 | onevent = "on" + event; 276 | if (window.addEventListener) { 277 | window.addEventListener(event, function (e) { 278 | for (var n = e.originalTarget; n; n = n.parentNode) { 279 | n[onevent] = null; 280 | } 281 | }, true) 282 | } 283 | window[onevent] = null; 284 | document[onevent] = null; 285 | if (document.body) { 286 | document.body[onevent] = null; 287 | } 288 | window.addEventListener(event, function (event) { 289 | event.stopPropagation(); 290 | }, true); 291 | document.addEventListener(event, function (event) { 292 | event.stopPropagation(); 293 | }, true) 294 | } 295 | 296 | function Fuck_switchAttr(selector,source,target) { 297 | [].forEach.call(document.querySelectorAll(selector),function(el){ 298 | el.setAttribute(target, el.getAttribute(source)); 299 | el.removeAttribute(source) 300 | }) 301 | } 302 | 303 | //执行 304 | (function() { 305 | function NoRedirect(){ 306 | document.querySelectorAll('a[id^="issue_"]').forEach(function (_this) {_this.target = '_blank';}); 307 | document.querySelectorAll('a[href*="AnonymousRedirect"]').forEach(function (_this) { 308 | _this.target = '_blank'; 309 | var _href = _this.href; 310 | _href = decodeURIComponent(_href.replace('https://adguardteam.github.io/AnonymousRedirect/redirect.html?url=','')); 311 | _this.href = _href; 312 | })} 313 | if (window.location.host == 'github.com'){ 314 | const observer = new MutationObserver(function () {NoRedirect()}); 315 | observer.observe(document, { childList: true, subtree: true }); 316 | } 317 | if (hackplus_whitelist["unFuck_UNION"] != 1 && window.location.host != "baike.baidu.com") { 318 | Fuck_UNION() 319 | } 320 | if (hackplus_whitelist["unFuck_ADV"] != 1) { 321 | if (tempHide[0] != "emCupid") { 322 | document.insertBefore(tempCssXML, document.documentElement) 323 | }; 324 | window.observer = new MutationObserver(function () { 325 | Fuck_ADV() 326 | }); 327 | window.Timer_FuckRAI = setTimeout(function () { 328 | Fuck_ADV(); 329 | if (document.readyState == "complete") { 330 | setTimeout(Fuck_ADV, 1e3); 331 | window.observer.observe(document.body, {childList: true,subtree: true}); 332 | clearTimeout(window.Timer_FuckRAI); 333 | } else { 334 | setTimeout(Fuck_ADV, 500); 335 | setTimeout(arguments.callee, 50) 336 | } 337 | }, 50); 338 | setTimeout(function(){ 339 | if (window.observer && !window.observer.observe) { 340 | Fuck_ADV(); 341 | window.observer.observe(document.body, {childList: true,subtree: true}); 342 | clearTimeout(window.Timer_FuckRAI); 343 | } 344 | }, 2e4); 345 | } 346 | if (hackplus_whitelist["Fuck_XZ"] == 1) { 347 | document.addEventListener("readystatechange", function () { 348 | Fuck_XZ("contextmenu"); 349 | Fuck_XZ("selectstart"); 350 | Fuck_XZ("copy"); 351 | window.getSelection = function(){return}; 352 | document.getSelection = function(){return}; 353 | }); 354 | var selectStyle = "html,body,div,* {-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important;-khtml-user-select:text!important} ::selection {color:#fff; background:#3390FF!important}" 355 | var xmlStyle = document.createProcessingInstruction("xml-stylesheet", 'type="text/css" href="data:text/css,' + encodeURIComponent(selectStyle) + '"'); 356 | document.insertBefore(xmlStyle, document.documentElement);//document.documentElement = 前,null = 后 357 | }; 358 | if (hackplus_whitelist["Fuck_WRS"] !== 1) { 359 | Fuck_WRS() 360 | } 361 | })(); 362 | 363 | //设置 364 | (function () { 365 | var OxConfigStyle = document.createElement("style"); 366 | OxConfigStyle.innerHTML = '.OxOOOOOA{display:block;margin:20px 50px}.OxOOOOOA .OxOOOOOA-slider{position:relative;display:inline-block;height:8px;width:32px;background:#d5d5d5;border-radius:8px;cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease}.OxOOOOOA .OxOOOOOA-slider:after{position:absolute;left:-8px;top:-8px;display:block;width:24px;height:24px;border-radius:50%;background:#eee;box-shadow:0 2px 2px rgba(0,0,0,.2);content:" ";-webkit-transition:all .2s ease;transition:all .2s ease}.OxOOOOOA .OxOOOOOA-input{display:none}.OxOOOOOA .OxOOOOOA-input~.OxOOOOOA-label{margin-left:8px;display:inline;font-weight:normal}.OxOOOOOA .OxOOOOOA-input:checked~.OxOOOOOA-slider:after{left:16px}.OxOOOOOA .OxOOOOOA-input:disabled~.OxOOOOOA-slider{background:#e2e2e2;cursor:default}.OxOOOOOA .OxOOOOOA-input:disabled~.OxOOOOOA-slider:after{background:#d5d5d5}.OxOOOOOA.OxOOOOOB .OxOOOOOA-input:checked:not(:disabled)~.OxOOOOOA-slider{background:#28e1bd}.OxOOOOOA.OxOOOOOB .OxOOOOOA-input:checked:not(:disabled)~.OxOOOOOA-slider:after{background:#1abc9c}#OxOOOOOO{border:2px solid #1abc9c;border-left-width:10px;box-shadow:2px 2px 5px rgba(26,188,156,.4);width:340px;padding-left:40px;position:fixed;top:calc(50% - 107px);left:calc(50% - 170px);z-index:240088290;background:#FFF url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAACNCAMAAADctOmQAAAAM1BMVEX///8avJwavJwavJwavJwavJwavJwavJwavJwavJwavJwavJwavJwavJwavJwavJwavJwr6QpGAAAAEXRSTlMATUhEPzo1MCsnIh0YEw4KBdDNbrgAAARxSURBVHgB7ZnplrQoDEATFjFChPd/2u+0TexYxKbGnn3m/rS8LCEgUADxG+CkrBEP/JIbnOA3QIc8alJ9X94DvkLvytnhSGpvyTuapEPmL9LnYz4BgObQhuAKGU9XvKNO5YYdv3IDgFoSdpapvI2NrFGqnsn9xQyaXvk2k90ZWo2XdscvPp95nZ5mbCDjB3E2zipZFFX/PJEdXBHpSc2SdWEi94AVM5siAH8DwCJ1KCRlN5iQrUSO5xiElHe4x+MB64rDmZ5HOCNxA5NitLAtMvgo+LRZTUiIrsAL1MvDC5FKgyvBG2XmFZSs8MvGoGhwC28p4khcSwVFoSUejE2rAQ0cdDihJjGMQxcyRTcuvS0Zi+cgx+NV3tbolLx7HPG7KUNlSkEtvQ4tXH1ttgqeyM2jTVCDiRYygUzyZysXS/3M+YZCoMLMhSJ2vJkkOtW34cMIdenPyiCHNe+TpVfNU1XhQgwneuld4Uq8rp5xzRUM7KW3SLxlHlhMV09VKn9QzbeutOvjnaJTg9Tea/ZBHtIoVR2wZAfM3LCoCC/WUJEMlWT+SGgqSRYjSXaAqlwXo1P2ZUsSKB/pGXR6SjmLDPS+ye80mxi1l8ugKO4c3xbQJp6dcs36DCLrkBgRIRVaRTrbDbu3XXsf8vq4reM4NjVhI7wQL8Nbk267S1WeW1kgw6siwZTiB4l43FSR4a4woY+F20DRyElQprYEQFGXmSu2+V3e4cdUvqfCBMJ7aHY0msj4Df8aOcbklMyffC2gjlh4GaoqU2ScD196ZLDhBdF+aU/WLwqONy+0HPBCrO+qdXU4kOqN6ovubNQKk8NOgk7Vqo6TrtRTOxYd7HQ1DaqgelKgI68P6gZX1Ko29PGqxgyv9CKbNTA6wxIzZ9LwIS8MFtkr2Zu57db6eDEQnsn8Df/YxWDCj+QouL6lOfDvycMx44D+Mjk9kXFXZ/MAkOM9edgOuNzO3ejyfm5Xhy/k9+XhxQBTWZFQ4/a5rCn+9aA6lxVM8YNlq08XAxu1VaS/XsZvuJP/lyPM+ZFMH+SHsvBc1hvp+kwW/jJZgvgXHBOEnWnkHbnlBU3ekDeH+FROiI9lwudykzZHM2BM9zCUXkqDB5B8D5/L9BM5wSOkzzCj75dZB0ei7RIVfgWEolIwbO2t1JdKA15wBEKayYQDYdfnQJv7wt0OQk7+Vt7QxF0Cx0wDskeyiDAnoRAWIn3zXmBGxQ7V11Nl6H+XbqBpzA06m4qPkLu996s2z9DhdDTMp6qvLrV72tt57x6b/CsjrJNLU7U1TYcbXuOpKzb+4HOq9+vN8eWIjNom1/64qKvgXawgiaCuqFnPvi7r+Ry72uS+svS3lKxqDl0mPQT17AB1uSpZ9bnLq5rZq16d+pafiJKSY3+x4AeOoQaV8V0qsJqfmD4GvT7FphanBvsoS6y9muo6Y/ev3PCjDOzOq6E0TPJ+uvFN2qBl+T3CARl/Q2Unk2ExZGjRy9ypFIa7jCYHhbaYB7EKisbwm/kFWdw9qasmoxkAAAAASUVORK5CYII=) repeat-y;text-align:left;color:#666;font-size:16px;border-radius:10px}.OxCloseBtn{width:20px;height:20px;fill:#1abc9c;stroke:#1abc9c;cursor:pointer;float:right;margin:10px;transition:0.5s} .OxCloseBtn:hover{fill:#F50000;stroke:#F50000;transform:rotate(180deg)}'; 367 | var OxConfig= document.createElement("div"); 368 | OxConfig.id = "OxOOOOOO"; 369 | OxConfig.innerHTML = '
'; 370 | var setting = function(){ 371 | var OxConfigDIV = document.getElementById("OxOOOOOO"); 372 | if (!OxConfigDIV) { 373 | document.body.appendChild(OxConfig); 374 | OxConfig.appendChild(OxConfigStyle); 375 | if (window.screen.height > window.screen.width){OxConfig.style.left= parseInt((window.screen.width-OxConfig.offsetWidth)/2) + "px"} 376 | if (hackplus_whitelist["unFuck_ADV"] == 1){document.getElementById("unFuck_ADV").setAttribute("checked", "checked")} 377 | if (hackplus_whitelist["unFuck_UNION"] == 1){document.getElementById("unFuck_UNION").setAttribute("checked", "checked")} 378 | if (hackplus_whitelist["Fuck_WRS"] == 1){document.getElementById("Fuck_WRS").setAttribute("checked", "checked")} 379 | if (hackplus_whitelist["Fuck_XZ"] == 1){document.getElementById("Fuck_XZ").setAttribute("checked", "checked")} 380 | [].forEach.call(document.querySelectorAll("#OxOOOOOO input:not(.tmp-active)"), function (checkbox){ 381 | checkbox.onclick = function(){checkbox_onClick(checkbox)}; 382 | }); 383 | var OxCloseBtn = document.querySelector(".OxCloseBtn"); 384 | OxCloseBtn.onclick = function(){ 385 | if(JSON.stringify(hackplus_whitelist) != hackplus_whitelistJSON_temp) { 386 | var c_msg = "设置已改变,尚未生效,是否刷新页面?"; 387 | if (confirm(c_msg)==true) location.reload() 388 | } 389 | document.body.removeChild(OxConfig); 390 | }; 391 | document.querySelector('#Fuck_removeHref').onclick = function(){ 392 | if(this.checked) { 393 | Fuck_switchAttr('a[href]','href','x-href') 394 | } else { 395 | Fuck_switchAttr('a[x-href]','x-href','href'); 396 | } 397 | setTimeout(function(){ 398 | document.body.removeChild(document.getElementById("OxOOOOOO")) 399 | },500) 400 | } 401 | }else if (OxConfigDIV) { 402 | document.body.removeChild(OxConfigDIV); 403 | } 404 | } 405 | document.addEventListener("keydown", function (event) { 406 | var e = event || window.event || arguments.callee.caller.arguments[0]; 407 | if (e.keyCode == 38 && e.ctrlKey) { 408 | setting(); 409 | } 410 | }) 411 | var floatWindowcss = "#hack-plus-container {\n z-index: 999999 !important;\n text-align: left !important; }\n @media print {\n #hack-plus-container {\n display: none; } }\n\n#hack-plus-container * {\n font-size: 13px !important;\n color: black !important;\n float: none !important;\n line-height: 13px !important;\n width: auto; }\n\n#hack-plus-main-head {\n position: relative !important;\n top: 0 !important;\n left: 0 !important; }\n\n#hack-plus-span-info {\n position: absolute !important;\n right: 1px !important;\n top: 0 !important;\n font-size: 11px !important;\n line-height: 11px !important;\n background: none !important;\n font-style: italic !important;\n color: #5a5a5a !important;\n text-shadow: white 0px 1px 1px !important; }\n\n#hack-plus-main select {\n background: white;\n height: auto; }\n\n#hack-plus-container input {\n vertical-align: middle !important;\n display: inline-block !important;\n outline: none !important;\n padding: 0px !important;\n margin: 0 !important;\n margin-right: 3px !important;\n background: white;\n border: 1px solid gray;\n cursor: pointer !important;\n height: auto; }\n\n#hack-plus-container input[type='number'] {\n width: 6ch !important;\n text-align: left !important;\n margin: 0 3px !important; }\n\n#hack-plus-container input[type='number']:hover::-webkit-inner-spin-button {\n height: 60px; }\n\n#hack-plus-container input[type='checkbox'] {\n position: static !important; }\n\n#hack-plus-container input[type='button'] {\n width: auto !important;\n height: auto !important; }\n\n#hack-plus-container li {\n list-style: none !important;\n margin: 3px 0 !important;\n border: none !important;\n float: none !important; }\n\n#hack-plus-container fieldset {\n border: 2px groove #ccc !important;\n -moz-border-radius: 3px !important;\n border-radius: 3px !important;\n padding: 4px 9px 6px 9px !important;\n margin: 2px !important;\n display: block !important;\n width: auto !important;\n height: auto !important; }\n\n#hack-plus-container legend {\n line-height: 20px !important;\n margin-bottom: 0px !important; }\n\n#hack-plus-container fieldset > ul {\n padding: 0 !important;\n margin: 0 !important; }\n\n#hack-plus-container ul#hack-plus-a_useiframe-extend {\n padding-left: 40px !important; }\n\n#hack-plus-rect {\n position: relative !important;\n top: 0 !important;\n left: 0 !important;\n float: right !important;\n height: 10px !important;\n width: 10px !important;\n padding: 0 !important;\n margin: 0 !important;\n -moz-border-radius: 3px !important;\n border-radius: 3px !important;\n border: 1px solid white !important;\n -webkit-box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.3), 0 0 3px rgba(0, 0, 0, 0.8) !important;\n -moz-box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.3), 0 0 3px rgba(0, 0, 0, 0.8) !important;\n box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.3), 0 0 3px rgba(0, 0, 0, 0.8) !important;\n opacity: 0.8 !important; }\n\n#hack-plus-dot,\n#hack-plus-cur-mode {\n position: absolute !important;\n z-index: 9999 !important;\n width: 5px !important;\n height: 5px !important;\n padding: 0 !important;\n -moz-border-radius: 3px !important;\n border-radius: 3px !important;\n border: 1px solid white !important;\n opacity: 1 !important;\n -webkit-box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.3), inset 0 2px 1px rgba(255, 255, 255, 0.3), 0px 1px 2px rgba(0, 0, 0, 0.9) !important;\n -moz-box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.3), inset 0 2px 1px rgba(255, 255, 255, 0.3), 0px 1px 2px rgba(0, 0, 0, 0.9) !important;\n box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.3), inset 0 2px 1px rgba(255, 255, 255, 0.3), 0px 1px 2px rgba(0, 0, 0, 0.9) !important; }\n\n#hack-plus-dot {\n right: -3px !important;\n top: -3px !important; }\n\n#hack-plus-cur-mode {\n left: -3px !important;\n top: -3px !important;\n width: 6px !important;\n height: 6px !important; }\n\n#hack-plus-content {\n padding: 0 !important;\n margin: 5px 5px 0 0 !important;\n -moz-border-radius: 3px !important;\n border-radius: 3px !important;\n border: 1px solid #a0a0a0 !important;\n -webkit-box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.3) !important;\n -moz-box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.3) !important;\n box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.3) !important; }\n\n#hack-plus-main {\n padding: 5px !important;\n border: 1px solid white !important;\n -moz-border-radius: 3px !important;\n border-radius: 3px !important;\n background-color: #f2f2f7 !important;\n background: -moz-linear-gradient(top, #fcfcfc, #f2f2f7 100%) !important;\n background: -webkit-gradient(linear, 0 0, 0 100%, from(#fcfcfc), to(#f2f2f7)) !important; }\n\n#hack-plus-foot {\n position: relative !important;\n left: 0 !important;\n right: 0 !important;\n top: 2px !important;\n padding-left: 2px;\n min-height: 20px !important; }\n\n#hack-plus-container .hack-plus-spanbutton {\n padding: 2px 3px !important;\n border: 1px solid #ccc !important;\n -moz-border-radius: 3px !important;\n border-radius: 3px !important;\n cursor: pointer !important;\n background-color: #f9f9f9 !important;\n -webkit-box-shadow: inset 0 10px 5px white !important;\n -moz-box-shadow: inset 0 10px 5px white !important;\n box-shadow: inset 0 10px 5px white !important;\n display: inline-block; }\n\n#hack-plus-container #hack-plus-savebutton {\n position: absolute !important;\n right: 2px !important; }\n\n#hack-plus-container label {\n cursor: pointer;\n user-select: none;\n display: inline; }\n"; 412 | var floatWindowdiv='
' 413 | function addStyle(aCss, aId, doc) { 414 | doc = doc || document; 415 | var head = doc.getElementsByTagName('head'); 416 | if (!head) { head = doc.documentElement;} else {head = head[0];} 417 | var style = doc.createElement('style'); 418 | if (aId) {style.setAttribute('id', aId);} 419 | style.setAttribute('type', 'text/css'); 420 | style.textContent = aCss; 421 | if (head) { return head.appendChild(style);} else {return null;} 422 | } 423 | function floatWindow() { 424 | addStyle(floatWindowcss); 425 | var div = document.createElement('div'); 426 | div.id = 'hack-plus-container'; 427 | div.innerHTML = floatWindowdiv; 428 | document.body.appendChild(div); 429 | div.onclick = setting; 430 | } 431 | if (window.screen.height > window.screen.width) { 432 | $(document).ready(function(){ 433 | if(top.location == self.location){floatWindow();} 434 | }); 435 | } 436 | 437 | })(); 438 | 439 | (function () { 440 | var XgetSelection = window.getSelection; 441 | var Fuck_Tooltip = document.createElement('div'); 442 | Fuck_Tooltip.id = 'Fuck_Tooltip'; 443 | Fuck_Tooltip.style.display = 'none'; 444 | // 鼠标事件:防止选中的文本消失 445 | document.addEventListener('mousedown', function (e) { 446 | if (e.target == Fuck_Tooltip || (e.target.parentNode && e.target.parentNode == Fuck_Tooltip) || (e.target.parentNode.parentNode && e.target.parentNode.parentNode == Fuck_Tooltip)) { // 点击了图标 447 | e.preventDefault(); 448 | } 449 | }); 450 | // 选中变化事件 451 | document.addEventListener("selectionchange", function () { 452 | if (!XgetSelection().toString().trim()) { 453 | Fuck_Tooltip.style.display = 'none'; 454 | } 455 | }); 456 | // 鼠标事件:防止选中的文本消失;显示、隐藏图标 457 | document.addEventListener('mouseup', function (e) { 458 | if (e.target == Fuck_Tooltip || (e.target.parentNode && e.target.parentNode == Fuck_Tooltip) || (e.target.parentNode.parentNode && e.target.parentNode.parentNode == Fuck_Tooltip)) { // 点击了图标 459 | e.preventDefault(); 460 | return; 461 | } 462 | var text = XgetSelection().toString().trim(); 463 | if (text && Fuck_Tooltip.style.display == 'none' && e.ctrlKey) { 464 | Fuck_Tooltip.style.top = e.pageY + 12 + 'px'; 465 | Fuck_Tooltip.style.left = e.pageX + 'px'; 466 | if(!document.querySelector('#Fuck_Tooltip')){ 467 | // 添加图标到 DOM 468 | document.documentElement.appendChild(Fuck_Tooltip); 469 | } 470 | Fuck_Tooltip.style.display = 'block'; 471 | try { 472 | if ($$customSurl && $$customStext) { 473 | var customSearch = '' + $$customStext.trim() + ' | '; 474 | } else { 475 | var customSearch = ''; 476 | } 477 | } catch (e) { 478 | var customSearch = ''; 479 | } 480 | Fuck_Tooltip.innerHTML = customSearch + '本站百度 | 影片搜索'; 481 | } else if (!text) { 482 | Fuck_Tooltip.style.display = 'none'; 483 | } 484 | }) 485 | })(); --------------------------------------------------------------------------------