Alessio Koci
Alessio Koci

Reputation: 1113

Maintaining data in google chrome extension

Example

  1. I click on my extension

  2. opens the html page of my extension (popup.html)

    enter image description here

  3. I add an element that has the text, the text of the prompt

    enter image description here

  4. "abandoned" the extension

  5. Control the listbox and the new first element inserted is not in the listbox

    enter image description here

There is my

popup.html

Upvotes: 0

Views: 415

Answers (2)

Fahd A.
Fahd A.

Reputation: 134

Better than HTML5 localStorage, consider leveraging the chrome.storage API

Upvotes: 1

Andrew Hall
Andrew Hall

Reputation: 3073

Imagine you opened a text file, wrote some text in it and didnt save it? What do you think would happen?

You need to save the state of the content somewhere and this can be done using localStorage.

Here is an article which explains all about it:

http://coding.smashingmagazine.com/2010/10/11/local-storage-and-how-to-use-it/

Upvotes: 3

Related Questions