Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
Reemplace el texto en la página web usando un script con Tampermonkey

Quiero reemplazar el nombre de especias en páginas como esta: https://www.inaturalist.org/observations?locale=en&place_id=97391&preferred_place_id=8860&taxon_id=61902&view=species

Así que quiero reemplazar, por ejemplo, 'Chrysolina fastuosa' por algo diferente con este código:

 var replaceArry = [ [/Chrysolina fastuosa/gi, 'Złotka jasnotowa'], ]; var numTerms = replaceArry.length; var txtWalker = document.createTreeWalker ( document.body, NodeFilter.SHOW_TEXT, { acceptNode: function (node) { if (node.nodeValue.trim() ) return NodeFilter.FILTER_ACCEPT; return NodeFilter.FILTER_SKIP; } }, false ); var txtNode = null; while (txtNode = txtWalker.nextNode () ) { var oldTxt = txtNode.nodeValue; for (var J = 0; J < numTerms; J++) { oldTxt = oldTxt.replace (replaceArry[J][0], replaceArry[J][1]); } txtNode.nodeValue = oldTxt; }

Pero ese código no funciona en esta página. Este código funciona perfectamente en encabezados, texto sin formato, pero no donde lo necesito. ¿Qué debo cambiar para que funcione?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!