Skip to content

Instantly share code, notes, and snippets.

@koreapyj
Created April 8, 2024 04:55
Show Gist options
  • Save koreapyj/9e79843a4d414b490c3b6c88024a50ae to your computer and use it in GitHub Desktop.
Save koreapyj/9e79843a4d414b490c3b6c88024a50ae to your computer and use it in GitHub Desktop.
쿠팡검색기
// ==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