- JavaScript 100%
| .gitignore | ||
| jd-block-log.js | ||
| JD-CAPTURE-ANALYSIS.md | ||
| jd-remove-ads.plugin | ||
| jd-remove-api.js | ||
| README.md | ||
Loon rules for JD (京东)
This plugin removes known JD ads, recommendations, and marketing popups. It also blocks selected log and statistics uploads.
Revision 20260917-4 also blocks all downloads under /taro-build/ and /app.m.jd.com/zip/ on storage.360buyimg.com and storage.jd.com, as requested. These packages include core order, cart, checkout, and search code. Those pages may fail to load. The rules return an empty 404 response before downloading the package; they do not remove packages already cached inside JD.
Install
Use Loon 3.5.1 (983) or later. The plugin uses the new Script syntax.
-
Copy this plugin URL:
https://git.m.maye.moe/maye/proxy_rules/raw/branch/main/jd-remove-ads.plugin -
Open the plugin list in Loon. Add a remote plugin with this URL, then enable 京东去广告.
-
Enable Rewrite, Script, and MitM in Loon. If MitM is not set up, use Loon to create and install its certificate. On iOS, enable full trust for that certificate in Settings → General → About → Certificate Trust Settings. Allow HTTPS decryption for the hosts listed in the plugin.
-
Start Loon, then close and reopen JD.
The plugin loads both scripts from this repository. You do not need to import the .js files separately.
Latest files
These links follow the main branch. They serve the latest files pushed to that branch.
| File | Use |
|---|---|
| jd-remove-ads.plugin | Install this in Loon. It contains the rules, script links, and MitM hosts. |
| jd-remove-api.js | Cleans ads and recommendations from API responses and XView templates. |
| jd-block-log.js | Blocks the reportInvokeLog upload on the shared API path. |
For a custom configuration, use these script URLs with the matching conditions and options from the plugin's [Script] section. Include its [Mitm] hosts. The scripts need Loon's HTTP request or response context; they are not scripts to run by hand.
Update
Refresh the remote plugin and its remote scripts in Loon, then close and reopen JD. Keep the same URLs for future updates. Loon caches remote scripts, so a plugin refresh alone may not fetch new script content. Cached JD content may also remain until the app refreshes it.
Plugin revision 20260917-4 appears in the description. Its scripts remain at revision 20260917-3; this update changes only download rules. Script URLs include their revision and a checksum of their content. After publishing, run python3 scripts/check-published.py if that local helper is available (requires Python 3 and curl) to check the bytes served by those exact URLs. This check first verifies the code at the published commit, so it will not cache old code under a new version URL before publication. Then refresh the plugin in Loon.
If a download fails, open the file link above in a browser. It must return the file text without a login page.
If ads remain, check the replacement response headers for basicConfig. When this script changes a response, it adds X-JD-Clean-Version: 20260917-3. For the captured config, data.JDAdsCore.adDegradationConfig.degraded must be "1", and data.JDUniformRecommend must be absent. The exact 20260917-2 API-script URL was confirmed to serve old bytes even after the new commit was published; refreshing that URL alone did not fix the server-side cache.
Revision 3 also sets the captured HTTPDNS and connection-prebuild controls to numeric 0, and socket optimization to string "0". These changes request regular API routing; their effect still needs a device check. Start JD once to receive basicConfig, then fully close and reopen it before refreshing the order list and account recommendations. The next capture must include the actual order/recommendation responses to verify data removal. Empty product images alone do not mean the recommendation cards have been removed.
If the published bytes match but the script still does not run, check the loaded configuration, including rules in the main profile. Loon uses the first matching response script; a response body rewrite prevents the response script from running. See the Script execution rules.
Check after installation
Check launch, home, search, product details and images, cart, account, orders, customer-service chat, and checkout. If a screen fails, disable the plugin and compare the result.
The current plugin does not remove the order banners “红包已生成…” and “领全年家庭…” or the full recommendation cards shown in captures 5 and 6. Images can be blank while text and card containers remain. Capture 6 confirms that revision 3 and its network configuration changes ran, so those changes did not resolve the reported UI problem. Script-contract and image-rule tests do not establish UI removal. The separate MitM-only diagnostic plugin was withdrawn after the user confirmed that it does not change capture results. See the capture analysis for the evidence and remaining limits.
Publish updates
Push the plugin and both scripts to main in this repository. Keep all three files at the repository root and readable without login.
If you use another repository or branch, change the script URLs and #!homepage in the plugin, plus the links in this README, before publishing.