0

In the document:

$(document).ready(function(){
    var ext = localStorage["plugin"];

    if(!ext || ext != 'true'){
        $('.class').css('display', 'inline');
    }
});

background.html

<script type="text/javascript">
    localStorage["plugin"] = 'true';
</script>

Im trying to create a plugin where the background page of the plugin sets a localstorage variable, and when the webpage is loaded, it checks if the localstorage variable is set. But now: When i run background.html (not loaded in the plugin yet) it should set the localstorage variable, and when i F5 the webpage it should keep the .class hidden. But it doesn't. What's wrong?

Thew

Thew
  • 15,789
  • 18
  • 59
  • 100
  • @bzlm When i try to edit the javascript in the document and do $('.class').html(ext), it doesn't edit the element. Can you do something with that? – Thew Nov 01 '11 at 17:51
  • Not unless you do a repro with a minimal example. :) – bzlm Nov 01 '11 at 17:55
  • @bzlm Why a repo? Why not an edit? – Thew Nov 01 '11 at 18:05
  • 2
    http://stackoverflow.com/questions/3937000/chrome-extension-accessing-localstorage-in-content-script – c69 Nov 01 '11 at 18:16

0 Answers0