Created
April 8, 2024 04:55
-
-
Save koreapyj/9e79843a4d414b490c3b6c88024a50ae to your computer and use it in GitHub Desktop.
쿠팡검색기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Coupang Search | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-04-07 | |
// @description 복수할테다 쿠팡 | |
// @author koreapyj | |
// @match https://www.coupang.com/np/search?* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=coupang.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const query = (new URLSearchParams(location.search)).get('q') | |
const query_segments = query.split(' ') | |
const results = document.querySelectorAll('.search-product') | |
for(const row of results) { | |
const name = row.querySelector('.name').textContent | |
for(const seg of query_segments) { | |
if(seg.startsWith('!')) { | |
if(name.includes(seg.substr(1))) { | |
row.style.display = 'none' | |
break | |
} | |
} | |
else { | |
if(!name.includes(seg)) { | |
row.style.display = 'none' | |
break | |
} | |
} | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment