BattleMaster Community

Community => General Talk => Topic started by: Tom on July 12, 2011, 01:06:18 PM

Title: Greasemonkey
Post by: Tom on July 12, 2011, 01:06:18 PM
Anyone familiar with Greasemonkey?

I have an idea for a script, but don't know if that's possible.

I would like it to add a user-editable field to a profile page, and store whatever I put there and retrieve it when I visit the site again. Something like the Internote extension, except that I want it embedded in the page.

Possible?
Title: Re: Greasemonkey
Post by: De-Legro on July 13, 2011, 05:14:29 AM
Its been a while since I used Greasemonkey. If I understand you correctly you want to allow people to make "notes" on profile pages, but store the texton the individuals computer rather then in the database? Last time I used Greasemonkey there was no supported way to have local storage. There were some ways around this, like running a separate server to store stuff, or attempting to access some of the browser specific local storage so that was always a hassle to support.

It looks like you might be able to use the new HTML LocalStorage cookie type thing, but I've not tried it.
Title: Re: Greasemonkey
Post by: Tom on July 13, 2011, 08:42:15 PM
Yeah, I was afraid the storage part would be the problem.

Anyone know of some other Firefox extension that could do this kind of trick?

Title: Re: Greasemonkey
Post by: Nosferatus on July 13, 2011, 08:46:16 PM
Don't know much about all this but, i've found this article: http://alternativeto.net/software/greasemonkey/
Ubiquity sounds good.
I am not sure if it suits your wishes.
Title: Re: Greasemonkey
Post by: De-Legro on July 14, 2011, 02:20:06 AM
If you only want it to run on Firefox, it is reasonably trival it has a Greasemonkey API with getValue() and setValue() which saves string data in the preferences.js file. If the script is for your personal use that would probably work fine, so long as you don't want to store massive amounts of data which would result in Firefox running slow for everything. If you need cross browser support, then Web Storage which was part of the HTML5 spec but now has its own separate spec should work for the majority of modern browsers.

With Firefox the other option is to simply write your own extension to do the job, then you have easy access to SQL lite solutions.