• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

145
Views
Change a specific link from text with Greasemonkey

I'm very new to Greasemonkey, so please be understanding. Here is my problem :

I'm currently doing some changes to a web game to make it more usable on a laptop to have a bigger fullscreen without getting rid of any functions. I've basically done everything by myself, but now there's something that I'm not able to do. I want to change the URL (clickable through some text) to my specific URL. I've figured that I can change the href value from the previous url (/maps) to my url (/search). But I'm not able to implement it into my script, as it doesn't work the same as the previous things I changed on the website.

Can anyone help? I think this is relatively easy, I just can't find anything on it, maybe I'm googling the wrong terms.

almost 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Based on the additional information in the comments, this should do

document.querySelector("a[href='/maps']").href = "/search";

while there's only one of these elements at the time of this answer. If that changes, you can use querySelectorAll instead and iterate the results then.

almost 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error