Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 930945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:25:16+00:00 2026-05-15T20:25:16+00:00

A page has the following in the html: <script type=text/javascript> // some code </script>

  • 0

A page has the following in the html:

<script type="text/javascript">
  // some code
</script>

My greasemonkey script needs to prevent that script from running. How can I do this?


Update: I understand that in the general case this is impossible. However, in my specific case, I may have a loophole?

<script type="text/javascript">
  if (!window.devicePixelRatio) {
    // some code that I -don't- want to be run, regardless of the browser
  }
</script>

Is there some way I can define window.devicePixelRatio before the embedded script runs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:25:17+00:00Added an answer on May 15, 2026 at 8:25 pm

    User scripts run after the page is loaded, so you aren’t able to.

    Unless, the code uses the “onload” event.

    User scripts are executed after the
    DOM is fully loaded, but before onload
    occurs. This means that your scripts
    can begin immediately and don’t need
    to wait for onload.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I'm using the following code: <head> <title>Wedding Page</title> <meta http-equiv=Content-Type content=text/html; charset=utf-8 />
In one page, it should show records that has the following selected month from
I just ran across a html page which has some scripts. The script tag
I have a page that I'm working on that has the following HTML markup:
I have a simple FAQ page in which each item has the following HTML
I have A single page that has the following structure <form runat=server><placeholder></placeholder></form> I have
I'm having some issues with the ordering of javascript execution in the following page:
I am running the following jQuery .get() call from an HTML page: <div id=fw_results>Results</div>
I wrote the following script for a page which has been loaded with a
I have the following html code: (that gets loaded via ajax into a div)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.