0

I am creating a browser extension that has to store data. I am going to have the client side language read from the page which is a game, and save data if mistakes were made , or the data is not already accessible. basically i'm trying to make a bot for a choice decision game when the posibilities and the questions are built in.

since the possibilities are final I would really like it if in some way i would be able to actually make the bot play for an hour and then have a file containing the entire game's deicisions.

well , I can't do that with javascript since it disables storing data, am I able to do it with another language which has access to the html DOM? I have no problem to even use some language that wasn't supposed to do that and then write a small library for DOM accessibility, as long as it allows DOM access, I have no idea which though.

edit: I haven't noticed I actually got answers to this. I realize the question is very vague(it's a very old one), but basically, I just built a simple html parser via python. I asked a friend of mine how I could build a bot, he said he simply did it by creating a browser extension, and I decided I'll give it a shot. anyways, yes, I should've resourced more into the browser's api and check for a way to store client's data.

5
  • 2
    developer.chrome.com/extensions/storage, if it's a chrome extension? What browser are you building it on Commented Jan 10, 2017 at 13:46
  • Why do you think you need a different language? Research the API of the browser you're making extension for. They all have APIs for storing client data. Today, JS is the language for browsers and it's not likely it will change any time soon. Commented Jan 10, 2017 at 13:47
  • github.com/typicode/lowdb/tree/master/examples#browser You could try lowDB out, pretty easy in-browser local storage Commented Jan 10, 2017 at 13:48
  • If all else fails, have a server that accepts requests from your plugin (You can use free services like heroku) and writes files. Later retrieve it from server and display it. Commented Jan 10, 2017 at 14:01
  • Here you go, thank me later Commented Nov 15, 2018 at 7:53

1 Answer 1

1

I'm not sure to clearly understand what you want to do but maybe you could use the local storage of your browser with Javascript. It's a simple way to store a little amount of data in a webApp context.

EDIT 1 :

Here's a little sample to help you :

// Store
localStorage.score = 5000;
// Retrieve data 
var score = localStorage.score;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.