Can bookmarklets store configuration data?

386
November 28, 2016, at 8:02 PM

As I understand, bookmarklets are executed with the origin of the page, where they are invoked. While this is pretty much the very reason they are useful, it limits the ability of the bookmarklet to keep state.

Specifically, I want to store configuration data for a bookmarklet. A use-case would be e.g. allowing persistent site-independent customization of the behaviour, without changing the code.

Additional criteria would include

  • Protecting bookmarklet configuration from unwanted access by other bookmarklets
  • Sharing bookmarklet cofiguration with trusted other bookmarklets
  • Protecting bookmarklet configuration from possible malicious websites.

An extreme example would be a bookmarklet syncing content with a third-party file hosting service like Dropbox, which would require securely storing an authentication key.

Is there any such possibility?

Additional notes

  • I am primarily using iOS to add behaviour on iOS and Windows. The iOS-part prevents the use of browser extensions (which anyway would limit portability).
  • I am trying to use bookmarklets specifically because I don't have access to a server, so some techniques used in bookmarklets related to webservices don't apply.

Possible Workarounds I thought of

  • Configuration might be put in the bookmarklet manually, e.g. by hosting the main javascript on a public service like github, and creating a proxy bookmarklet that loads it with #-options, e.g.

    javascript:function runBmlet(url){ var s=document.createElement("script"); s.src=url; document.head.appendChild(s); }; runBmlet("http://url.of/my/script.js#DropboxData=YOURDATAHERE");
    

    which is however much less convenient on the long run than storing the configuration in something akin to localStorage.

Rent Charter Buses Company
READ ALSO
Using a locally stored video in an html site

Using a locally stored video in an html site

I need advice for the following problem: I have a video stored on the local device, let's say in /home/user/videomp4 And I want to play this video with a html5 video tag on a website I get from a webserver

376
ReactJS Error: “Uncaught TypeError: this.props.alarms.forEach is not a function”

ReactJS Error: “Uncaught TypeError: this.props.alarms.forEach is not a function”

To not deal with webpack and only focus purely on understanding React itself, I've started off by having all of my JS code inside an inlined script tag in the indexhtml file

518
d3 - how to show duration interval instead of tickValues

d3 - how to show duration interval instead of tickValues

Let's consider a horizontal bar chart as shown in the attached photoI need to show the duration of each segment along with the x-axis

425
Error in running unit test for Vue webapp

Error in running unit test for Vue webapp

I am writing a webapp with VueJs, I am trying to setup unit test for it, I got inspired from vue-mdl unit-testsBut the tests are not running properly for my code and I am getting vm

436