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 7559697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:42:00+00:00 2026-05-30T12:42:00+00:00

I am developing a Chrome application on a 3rd party website. The document that

  • 0

I am developing a Chrome application on a 3rd party website.

The document that I am trying to alter has the following page format:

<head>
.
.meta data here
.
</head>
<body>
  <script type="text/javascript">
    function a1(){
      ..contents of function a1
    }
  </script>

  .
  .other contents of body
  .
  <script type="text/javascript">
     a1();  // <-- I don't want this to be executed
  </script>
</body>

My problem is I want the entire page to be loaded, except the function call a1();

So I thought of a simple solution: BEFORE the function definition ie; function a1(){..}, I want to create a1 as a CONSTANT function which does nothing, therefore rendering the a1() call useless.

Problem is that if I define the function to be constant in my js which run_at document_start, the execution environment is different, hence it wont affect the page.

So the alternate to run in the same execution environment is by INJECT the code using innerHTML+=” … “

Another alternate is to construct a script element using “createElement” and the src is an external js file which has to be loaded before execution.

Both the alternatives does not work, as the parse tree isn’t created in the run_at document_start script.

So, I thought of an other solution. I added the listeners for DOMModifySubTree event, hoping to alter the parse sequence(I know, it sounds funny :)) so that the function isn’t called. Doesn’t help.

So, my question is how do I prevent the call to a1() function??
P.S – I cannot contact the 3rd party website developer.

  • 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-30T12:42:02+00:00Added an answer on May 30, 2026 at 12:42 pm

    Sorry for the late late reply. What I had originally done to skip the function call is that I ran a script at document start and injected it into the “document” (as JS runs in separate envi). In that injected script I used

    const a1=function(){};
    

    This way, when the function is being declared again, it is NOT overwritten, hence the function is not executed (ie; it is executing our dummy function), thus essentially breaking the code. 🙂

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

Sidebar

Related Questions

We are developing a chrome extension that has auto-updating capability. When the extension is
I am developing an asp.net page/application. I have created a textbox that i set
Developing a website and just trying to get back into the swing of (clever)
I'm developing a web application that requries alot of keyboard navigation. I've taken control
I'm developing an ASP.NET application for an intranet site that is using Windows/NTLM/WIA/whatever authentication.
I'm developing a Chrome extension that ships jQuery and jquery is referenced from the
I have a WPF TaskBar like application that i am developing for fun and
We are developing a web application that will be sold to many clients. There
I'm developing a .NET 3.5 XBAP application that runs perfectly fine in FF3 and
I'm developing a web application that is targeted at IE and during testing would

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.