Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

112
Visualizações
Chrome extension to filter search results

I have recently been annoyed with the amount of aggregation sites that keep popping up in Google Search results. They offer (to me) nothing useful and obscure the valuable sites. Unfortunately, Google removed their offering to ignore/skip sites in results a while ago. I am starting to work on a Chrome extension to filter these out of search results, and ran into a big of a snag.

The first thing I tried was the webRequest.onBeforeRequest, but ran into issues with differences in Manifest v3. I realized that what I am going for might not be possible, and thought I would check.

The only thing I want to be able to do is modify Google Search requests to include a list of excluded sites, using the -site:<url> syntax that Google supports. For example, a search for "yargs vs commander" might become "yargs vs commander -site:npmtrends.com", assuming the user had set npmtrends.com in the blacklist.

However, I am not sure whether this is possible with Chrome extensions? If it is, will the resulting search display also include the -site:npmtrends.com (ie. in browser bar)? If so, could I simply filter it out again at that point (as it will be added again for future requests)?

I have been using declarativeNetRequest API work (Manifest v3), coupled with a redirect rule. However, while a regexFilter like [?&]q=[^&#]+ and regexSubstitution like \\0+-site%3Anpmtrends.com does work, it also results in an infinite redirection loop (since condition is always true). Google's regex syntax does not seem to support lookbehinds/lookaheads, significantly limiting possibilities.

It is quite frustrating that Manifest v3 seems to be a step backward in power regarding URL requests, as this would be easy if using JS (since it requires several checks over the whole string)...

Welcoming any feedback/recommendations!

EDIT: Apparently I forgot (to my shame) to include examples/link to my attempts...my apologies! I am unable to update with examples at the moment, but do have a GitHub link (for the little value that contains).

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda