您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove promoted pins
// ==UserScript== // @name Pinterest - Remove Promoted // @namespace https://github.com/valacar // @version 0.1.0 // @description Remove promoted pins // @author Valacar // @include https://*.pinterest.tld/* // @require https://unpkg.com/[email protected]/dist/xhook.min.js // @grant none // @license MIT // ==/UserScript== /* 3rd party script to modify XHR responses: https://github.com/jpillora/xhook */ (function() { "use strict"; function isGoodPin(data) { return !(data.is_promoted && data.is_promoted === true) } function jsonFilter(response, isSearchResults) { let json = JSON.parse(response.text); let data; if (isSearchResults) { data = json.resource_response.data.results; json.resource_response.data.results = data.filter(isGoodPin); } else { data = json.resource_response.data; json.resource_response.data = data.filter(isGoodPin); } return JSON.stringify(json); } xhook.after(function(request, response) { if (request.url.match(/\/resource\/(UserHomefeedResource|FollowingFeedResource|RelatedModulesResource|BoardContentRecommendationResource|BoardFeedResource)\/get\//)) { response.text = jsonFilter(response, false); } else if (request.url.match(/\/resource\/BaseSearchResource\/get\//)) { response.text = jsonFilter(response, true); } }); })();