...

View Full Version : Is this how to store local storage? Can GC & FF extensions change elements on page?



Keysle
05-21-2012, 10:40 PM
is "localStorage" a native variable to javascript?
On lin 36 & 37 is there anything else involved in getting that local storage to store? Those lines are local storage right?
Is it really that easy?
I was just reading this HUGE post (http://www.html5rocks.com/en/tutorials/offline/storage/) and immediately stressed me out. I'm used to working off small examples and diving in bit by bit. It was the first article on google so I trusted it to be the most appropriate for introductions. (which means not reading more than 500 words before I get some sample code)
http://i.imgur.com/CkqVO.png


In addition, can Google Chrome & FireFox extensions change page elements? The reason I think it can do this is because google chrome says this http://i.imgur.com/J0uQt.png
Which (to me) implies that the extension has access to page data.
If that is the case. How are localStorage variables not mixing? How can I access that page data? I don't care about browser history, I just want to change page elements. Is this possible?


If this is the case. Is there a way I can have the extension close itself or not open at all? Sometimes I just want the "extension" to provide a simple function. That's all. Thanks!


I had Silverbird and the tutorialzine example (http://.com/2010/06/making-first-chrome-extension/) extension. They were both different size. Odd thing is that I never saw a size specification in the style.css in the tutorialzine example. How can I specify the size of the popup extension?

Logic Ali
05-22-2012, 02:20 AM
is "localStorage" a native variable to javascript?
On lin 36 & 37 is there anything else involved in getting that local storage to store? Those lines are local storage right?
Is it really that easy?Yes. localStorage is a native object to which properties can be assigned directly, but they are always stored as strings regardless of their type when assigned. You can also use setItem/getItem methods.

The test on line 10 is flawed because it fails to check for localStorage support.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum