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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:25:45+00:00 2026-05-18T02:25:45+00:00

I have written a greasemonkey script which will do GM_xmlhttpRequest to the next 2

  • 0

I have written a greasemonkey script which will do GM_xmlhttpRequest
to the next 2 pages of the google results page.. i.e. if my current
page is 1 then my script will do GM_xmlhttpRequest to page no 2 and
3..

Now my script will extract out all the urls from these 3 pages and
will reorder them

For that I have done:

unsafeWindow.addEventListener('load',Reorder,true);

function Reorder()
{
alert("onload fired")
..........
..........
// some code overhere to collect all the urls into an array
// and to reorder the urls in the array

Now I inject these urls into my reference pages i.e. I keep a
reference to the nodes where I am supposed to append these urls as
childNodes.. and along with that I modify the links to page no. 2 and
3(at the bottom of results page) so that now they’ll point to my these newly dynamically generated
pages. For that I modify the onclick attribute of these links that’ll
open a new window in the current window itself and will write the
modified responseXML object to the newly created window.

Now everything is working awesome i.e. url
extraction, reordering, creating new window, writing the responseXML
object ..

But the problem is that when my these modified links are clicked and
my newly generated window replaces the parent window it doesn’t give the alert of "onload fired"
…infact it doesn’t stop loading i.e. it displays the desired
content but is never fully loaded since status bar doesn’t shows
"done" in fact it shows "waiting for clients1.google.com"…

So does anyone knows what exactly is going wrong over here.. is it due
to some script running on google search page that is somehow
synchronised with the contents of the page…

Basically for those who do not know how greasemonkey will work…..my code is just removing all the anchor tags that contain url and inserting similar anchor tags with different urls…the question in nutshell is that i am just making a new window and doing document.write(this newly created html page)…and other than the urls I am not changing anything….
so basically are the scripts somehow synchronized with the urls present on the page or does it really matter to the scripts what data is contained within as long as the body contains the same DOM tree.

Please people whatever you know or have idea about it.. please tell me…

i need to finish this thing quickly..

  • 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-18T02:25:46+00:00Added an answer on May 18, 2026 at 2:25 am

    When you use document.write to write content into a new page, you need to use document.close() to tell the browser that you’re done – until then, the browser thinks there is more content to come and continues to display the loading icon.

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

Sidebar

Related Questions

No related questions found

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.