🗺 feat: 新增及优化高德地图相关内容

This commit is contained in:
Demo 2023-05-10 20:20:20 +08:00
parent 1178ffd6b8
commit eb925eb67b
5 changed files with 90 additions and 35 deletions

View File

@ -1,16 +1,16 @@
// ==UserScript==
// @ScriptName 高德地图净化
// @ScriptName 高德地图净化[墨鱼版]
// @Author @ddgksf2013
// @ForHelp 若有屏蔽广告的需求可公众号后台回复APP名称
// @WechatID 公众号墨鱼手记
// @TgChannel https://t.me/ddgksf2021
// @Contribute https://t.me/ddgksf2013_bot
// @Feedback 📮 ddgksf2013@163.com 📮
// @UpdateTime 2023-02-08
// @UpdateTime 2023-04-25
// @Suitable 自行观看“# > ”注释内容
// @Attention 使用前请卸载高德地图,挂载脚本然后使用
// @Attention 如需引用请注明出处,谢谢合作!
// @Version V1.0.19
// @Version V1.0.22
// @ScriptURL https://github.com/ddgksf2013/Rewrite/raw/master/AdBlock/Amap.conf
// ==/UserScript==
@ -18,39 +18,35 @@
hostname=*.amap.com
# > 高德地图_请自行添加本地分流@ddgksf2013
;host, amdc.m.taobao.com, reject
# > 高德地图_amdc处理[Anti已将Amdc分流删除,故更换屏蔽策略]@ddgksf2013
^http:\/\/amdc\.m\.taobao\.com url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amdc.min.js
# > 高德地图_底部tab栏角标@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/message\/notice\/list url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/message\/notice\/list url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_路线规划下方广告@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/faas\/amap-navigation\/card-service-route-plan\? url reject-dict
# > 高德地图_首页右中广告@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/shield\/frogserver\/aocs\/updatable url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/shield\/frogserver\/aocs\/updatable url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_附近页面@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/shield\/search\/nearbyrec_smart url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/shield\/search\/nearbyrec_smart url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_打车页面处理@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/promotion-web\/resource url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/promotion-web\/resource url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_Tip请求@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/boss\/order_web\/\w{8}_information url reject-200
# > 高德地图_首页底部处理@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/faas\/amap-navigation\/main-page url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/faas\/amap-navigation\/main-page url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_通用广告请求@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/asa\/ads_attribution url reject
# > 高德地图_开屏广告@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/valueadded\/alimama\/splash_screen url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/valueadded\/alimama\/splash_screen url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_首页顶部推广@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/msgbox\/pull url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/msgbox\/pull url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_我的页面@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/shield\/dsp\/profile\/index\/nodefaas url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/shield\/dsp\/profile\/index\/nodefaas url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_搜索框热词@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/shield\/search\/new_hotword url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.js
^https?:\/\/.*\.amap\.com\/ws\/shield\/search\/new_hotword url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Other/Amap.min.js
# > 高德地图_搜索框scene@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/shield\/scene\/recommend url reject-dict
# > 高德地图_首页左上角gif@ddgksf2013
^https?:\/\/.*\.amap\.com\/uploadimg\/\w+\.gif url reject-img
# > 高德地图_首页右中'2022出行报告'[已从根本上解决]@ddgksf2013
;^https?:\/\/img\.alicdn\.com\/imgextra\/i1\/O1CN01z5u64r1EdKvtRa19q_!!6000000000374-2-tps-120-120\.png
# > 高德地图_左下天气@ddgksf2013
^https?:\/\/.*\.amap\.com\/ws\/valueadded\/weather url reject-dict

View File

@ -2,14 +2,14 @@
> 应用名称墨鱼自用高德地图去广告脚本
> 脚本作者@ddgksf2013
> 微信账号墨鱼手记
> 更新时间2022-01-26
> 更新时间2022-04-25
> 通知频道https://t.me/ddgksf2021
> 贡献投稿https://t.me/ddgksf2013_bot
> 问题反馈ddgksf2013@163.com
> 特别提醒如需转载请注明出处谢谢合作
***********************************************/
const version = "V1.0.24";
const version = "V1.0.28";
var obj = JSON.parse($response.body);
if (-1 != $request.url.indexOf("valueadded/alimama/splash_screen")) {
@ -25,6 +25,7 @@ if (-1 != $request.url.indexOf("valueadded/alimama/splash_screen")) {
(a) => "LoginCard" == a.dataType
)),
obj.data?.pull3?.msgs && (obj.data.pull3.msgs = []),
obj.data?.business_position && (obj.data.business_position = []),
obj.data?.mapBizList && (obj.data.mapBizList = []),
$done({ body: JSON.stringify(obj) });
else if (-1 != $request.url.indexOf("profile/index/node"))
@ -38,30 +39,32 @@ else if (-1 != $request.url.indexOf("new_hotword"))
obj.data?.header_hotword && (obj.data.header_hotword = []),
$done({ body: JSON.stringify(obj) });
else if (-1 != $request.url.indexOf("ws/promotion-web/resource")) {
let o = ["icon", "banner", "tips", "popup", "bubble"];
for (let e of o) obj.data?.[e] && (obj.data[e] = []);
let e = ["icon", "banner", "tips", "popup", "bubble"];
for (let o of e) obj.data?.[o] && (obj.data[o] = []);
$done({ body: JSON.stringify(obj) });
} else if (-1 != $request.url.indexOf("ws/msgbox/pull"))
obj.msgs && (obj.msgs = []),
obj.pull3?.msgs && (obj.pull3.msgs = []),
$done({ body: JSON.stringify(obj) });
else if (-1 != $request.url.indexOf("ws/shield/frogserver/aocs"))
obj.data?.operation_layer &&
(obj.data.operation_layer = { status: 1, version: "", value: "" }),
obj.data?.home_business_position_config &&
(obj.data.home_business_position_config = {
status: 1,
version: "",
value: "",
}),
else if (-1 != $request.url.indexOf("ws/message/notice/list"))
obj.data?.noticeList && (obj.data.noticeList = []),
$done({ body: JSON.stringify(obj) });
else if (-1 != $request.url.indexOf("search/nearbyrec_smart")) {
let t = ["coupon", "scene", "activity", "commodity_rec"];
else if (-1 != $request.url.indexOf("ws/shield/frogserver/aocs")) {
for (let t of [
"gd_notch_logo",
"home_business_position_config",
"his_input_tip",
"operation_layer",
])
obj.data?.[t] && (obj.data[t] = { status: 1, version: "", value: "" });
$done({ body: JSON.stringify(obj) });
} else if (-1 != $request.url.indexOf("search/nearbyrec_smart")) {
let i = ["coupon", "scene", "activity", "commodity_rec"];
obj.data &&
(t.forEach((a) => {
(i.forEach((a) => {
delete obj.data[a];
}),
obj.data.modules &&
(obj.data.modules = obj.data.modules.filter((a) => !t.includes(a)))),
(obj.data.modules = obj.data.modules.filter((a) => !i.includes(a)))),
$done({ body: JSON.stringify(obj) });
} else $done({});

19
Scripts/AdBlock/Other/Amap.min.js vendored Normal file
View File

@ -0,0 +1,19 @@
/***********************************************
> 应用名称墨鱼自用高德地图去广告脚本
> 脚本作者@ddgksf2013
> 微信账号墨鱼手记
> 更新时间2022-04-25
> 通知频道https://t.me/ddgksf2021
> 贡献投稿https://t.me/ddgksf2013_bot
> 问题反馈ddgksf2013@163.com
> 特别提醒如需转载请注明出处谢谢合作
***********************************************/
const version = 'V1.0.28';
var obj=JSON.parse($response.body);if(-1!=$request.url.indexOf("valueadded/alimama/splash_screen")){if(obj.data&&obj.data.ad)for(let a of obj.data.ad)a.set.setting.display_time=0,a.creative[0].start_time=2240150400,a.creative[0].end_time=2240150400;$done({body:JSON.stringify(obj)})}else if(-1!=$request.url.indexOf("faas/amap-navigation/main-page"))obj.data?.cardList&&(obj.data.cardList=Object.values(obj.data.cardList).filter(a=>"LoginCard"==a.dataType)),obj.data?.pull3?.msgs&&(obj.data.pull3.msgs=[]),obj.data?.business_position&&(obj.data.business_position=[]),obj.data?.mapBizList&&(obj.data.mapBizList=[]),$done({body:JSON.stringify(obj)});else if(-1!=$request.url.indexOf("profile/index/node"))delete obj.data.tipData,obj.data?.cardList&&(obj.data.cardList=Object.values(obj.data.cardList).filter(a=>"MyOrderCard"==a.dataType||"GdRecommendCard"==a.dataType)),$done({body:JSON.stringify(obj)});else if(-1!=$request.url.indexOf("new_hotword"))obj.data?.header_hotword&&(obj.data.header_hotword=[]),$done({body:JSON.stringify(obj)});else if(-1!=$request.url.indexOf("ws/promotion-web/resource")){let e=["icon","banner","tips","popup","bubble"];for(let o of e)obj.data?.[o]&&(obj.data[o]=[]);$done({body:JSON.stringify(obj)})}else if(-1!=$request.url.indexOf("ws/msgbox/pull"))obj.msgs&&(obj.msgs=[]),obj.pull3?.msgs&&(obj.pull3.msgs=[]),$done({body:JSON.stringify(obj)});else if(-1!=$request.url.indexOf("ws/message/notice/list"))obj.data?.noticeList&&(obj.data.noticeList=[]),$done({body:JSON.stringify(obj)});else if(-1!=$request.url.indexOf("ws/shield/frogserver/aocs")){for(let t of["gd_notch_logo","home_business_position_config","his_input_tip","operation_layer"])obj.data?.[t]&&(obj.data[t]={status:1,version:"",value:""});$done({body:JSON.stringify(obj)})}else if(-1!=$request.url.indexOf("search/nearbyrec_smart")){let i=["coupon","scene","activity","commodity_rec"];obj.data&&(i.forEach(a=>{delete obj.data[a]}),obj.data.modules&&(obj.data.modules=obj.data.modules.filter(a=>!i.includes(a)))),$done({body:JSON.stringify(obj)})}else $done({});

View File

@ -0,0 +1,21 @@
/***********************************************
> 应用名称墨鱼自用amdc脚本
> 脚本作者@ddgksf2013
> 微信账号墨鱼手记
> 更新时间2022-04-25
> 通知频道https://t.me/ddgksf2021
> 贡献投稿https://t.me/ddgksf2013_bot
> 问题反馈ddgksf2013@163.com
> 特别提醒如需转载请注明出处谢谢合作
***********************************************/
//使用AMDC的APP有咸鱼、淘宝、盒马、高德、菜鸟、飞猪
const version = "V1.0.4";
var ua = $request.headers["User-Agent"] || $request.headers["user-agent"];
-1 != ua.indexOf("AMap") ||
-1 != ua.indexOf("Cainiao") ||
-1 != ua.indexOf("%E9%A3%9E%E7%8C%AA%E6%97%85%E8%A1%8C")
? $done({ body: "empty" })
: $done({});

16
Scripts/AdBlock/Other/Amdc.min.js vendored Normal file
View File

@ -0,0 +1,16 @@
/***********************************************
> 应用名称墨鱼自用amdc脚本
> 脚本作者@ddgksf2013
> 微信账号墨鱼手记
> 更新时间2022-04-25
> 通知频道https://t.me/ddgksf2021
> 贡献投稿https://t.me/ddgksf2013_bot
> 问题反馈ddgksf2013@163.com
> 特别提醒如需转载请注明出处谢谢合作
***********************************************/
//使用AMDC的APP有咸鱼、淘宝、盒马、高德、菜鸟、飞猪
const version = 'V1.0.4';
var ua=$request.headers["User-Agent"]||$request.headers["user-agent"];-1!=ua.indexOf("AMap")||-1!=ua.indexOf("Cainiao")||-1!=ua.indexOf("%E9%A3%9E%E7%8C%AA%E6%97%85%E8%A1%8C")?$done({body:"empty"}):$done({});