您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes ads with only "Canada" or provence name listed as location
- // ==UserScript==
- // @name Kijiji: Hide Non-Local Listings
- // @description Removes ads with only "Canada" or provence name listed as location
- // @match https://www.kijiji.ca/b*
- // @version 0.1
- // @author mica
- // @namespace greasyfork.org/users/12559
- // @license MIT
- // ==/UserScript==
- const list = [
- 'Canada',
- 'Alberta',
- 'British Columbia',
- 'Manitoba',
- 'New Brunswick',
- 'Newfoundland',
- 'Northwest Territories',
- 'Nova Scotia',
- 'Ontario',
- 'Prince Edward Island',
- 'Québec',
- 'Saskatchewan',
- 'Yukon'
- ];
- const observer = new MutationObserver(() => {
- var elements = document.querySelectorAll('p[data-testid="listing-location"]')
- elements.forEach((element) => {
- if (list.includes(element.innerText)) {
- element.closest('li').style.display = 'none';
- }
- });
- });
- observer.observe(document.body, {
- childList: true,
- subtree: true
- });