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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:44:14+00:00 2026-05-12T08:44:14+00:00

I want to reload a page so that it does not cause the effects

  • 0

I want to reload a page so that it does not cause the effects of a full-page refresh, like displaying “Loading…” on the page’s tab.

Here’s the code I have so far. My theory was that I could overwrite the body section with a <frame>-wrapped version of the updated site, gotten via GM_xmlhttpRequest.

reloader.js

setInterval(reload, 10000);

function reload() {
    GM_xmlhttpRequest({method: 'GET',
            url: location.href,
            onload: function(responseDetails) {
                document.body.innerHTML =
                                '<frame>\n'
                                + responseDetails.responseText
                                + '</frame>\n';
            }});
}

When testing with Firebug on stackoverflow.com, I found that this script updates the body as if I had performed a full-page refresh, without the side effects. Yay! Mysteriously, the <frame> tags are nowhere to be found.

Questions

What I have right now does a good job of reloading the page, but I have two questions:

  1. How do I stay logged in after a reload? Specifically, what do I need to do to keep me logged in to Stack Overflow?
  2. Can someone explain why my script works? Why are there no <frame> tags within the body?

Updates

I’ve incorporated elements from Cleiton, Havenard, and Henrik’s answers so far. I tried sending cookies via the header: { 'Cookie': document.cookie } entry in the data sent through GM_xmlhttpRequest. This sent some, but not all of the cookies. It turns out that if I turn on third party cookies in the Firefox then I’ll get the necessary extra cookies (.ASPXAUTH, ASP.NET_SessionId, and user), but this is a bad idea.

  • 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-12T08:44:14+00:00Added an answer on May 12, 2026 at 8:44 am
    document.body.innerHTML =
            responseDetails.responseText.match(/<body>([\s\S]*)<\/body>/i)[1];

    Update: For <body> with properties:

    document.body.innerHTML =
            responseDetails.responseText.match(/<body[^>]*>([\s\S]*)<\/body>/i)[1];
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I want a whole page to reload every N seconds, I would put
I want to reload the data within a table view that is contained on
I have a test environment for a database that I want to reload with
First, I want to note that I do not want to request the offline_access
I am building a rails app i want to reload a page if a
My problem is, that the browsers' (IE&FF) autocomplete does not work for my login
does it reload the entire page or does it have the intelligence to only
Here's what I have: A web application that runs in a single HTML page
I want to reload just my web layer classes without reloading my service layer
want to know why String behaves like value type while using ==. String s1

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.