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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:27:50+00:00 2026-05-27T14:27:50+00:00

I badly need someway to store data within an edited DOM of a page,

  • 0

I badly need someway to store data within an edited DOM of a page, and then access it from the userscript. Also, I need this to be done on Google Chrome.
This is my current script, but I can’t get it working:

The internal script:

var o_shout_tabs=unsafeWindow.localStorage.getItem('va_shout_tabs')||true;
var o_profile_damage=unsafeWindow.localStorage.getItem('va_profile_damage')||true;
var o_allies=unsafeWindow.localStorage.getItem('va_allies')||true;

The edited DOM:

<script type="text/javascript">
     function saveData(a,b){
         var unsafeWindow=this['unsafeWindow']||window;
         unsafeWindow.localStorage.setItem('va_'+a,b);
     }
</script>
<input type="checkbox" value="1" onclick="saveData('shout_tabs', this.checked)"/>
<input type="checkbox" value="1" onclick="saveData('profile_damage', this.checked)"/> 
<input type="checkbox" value="1" onclick="saveData('allies', this.checked)"/>

However, this always returns false when I test with for example o_shout_tabs==true, no matter the input (although, if it hasn’t received an input at all, it returns true).

  • 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-27T14:27:51+00:00Added an answer on May 27, 2026 at 2:27 pm

    What always returns false?

    Anyway, the init logic is off. For boolean values, code like this:

    var o_shout_tabs=unsafeWindow.localStorage.getItem('va_shout_tabs')||true;
    

    will always return true or a string.

    Use this code:

    function getBoolFromStorageDefaultTrue (varName) {
        var val = localStorage.getItem (varName);
        if (val == null)
            return true;
        return (  (val == "false")  ?  false  :  true  );
    }
    
    var o_shout_tabs        = getBoolFromStorageDefaultTrue ('va_shout_tabs');
    var o_profile_damage    = getBoolFromStorageDefaultTrue ('va_profile_damage');
    var o_allies            = getBoolFromStorageDefaultTrue ('va_allies');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to have this API badly quickly. I went on Microsoft Connect but
This does not work and I need it badly $('some+multi+word+string').replace('+', ' ' ); always
I am having an absolute headache figuring this out. I badly need some help
I am completely new to C and need help with this badly. Im reading
I need it so badly I have been trying it from 3 days but
As you may know, Silverlight 3 doesn't support IMultiValueConverter and... I badly need it.
Sorry for a badly-phrased question. I have a requirement coming from a non-technical person
Hi Java programmers. I badly need your help. I have a JavaFX/Java ME application.
I have been trying to replicate the buffer overflow example3 from this article aleph
So a follow up to this question: getting bad request from ruby on rails

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.