2

I've this bookmarklet in Firefox:

javascript:void(location.href='https://example.com/url='+document.location.href)

It works when I've enabled javascript for the actual webpage (the url which I want to send to example.com). My problem is I want to use it with NoScript disabling javascript for everything except for example.com. Obviously, the bookmarklet doesn't work with javascript disabled.

I would like to know if there is any alternative to create a bookmarklet which works with javascript disabled. I'm only interested in the bookmarklet, but feel free to comment about any extension which helps me with this (without sending any info to third party servers).

If necessary, I can write additional code in the server. And I've always enabled javascript for example but I don't want to enable javascript for the actual webpage.

1 Answer 1

2

NoScript Bug? 😕

Actually this seems more like a problem with NoScript. There should be a setting to allow bookmarklets on blocked sites. If there isn't one, then I would consider this a bug in the extension.

Data-url Bookmarks 😒

Sadly (?) with javascript disabled you cannot execute javascript bookmarklets. Also any “regular” bookmark cannot get a hold of the current url.

For example the following data-url bookmark does NOT work at all:

data:text/html,<script>location.href='https://example.com/url='+document.referrer</script>

On the other hand this data-url would work if it was opened in a new tab on behalf of the original page (impossible to do with scripts disabled):

data:text/html,<script>location.href='https://example.com/url='+opener.location.href</script>

Smart bookmarks 😐

I think the most unobtrusive solution would be to use a (smart) keyword bookmark. In bookmarks you can use %s as a placeholder and assign a keyword to it. Usually this makes it possible to add custom search functionality into the location bar. For example you would add a bookmark to https://superuser.com/search?q=%s and assign the keyword super to it, so you can search on superuser.com by writing something like super bookmarklet into the location bar.

In your case you would add a bookmark to https://example.com/url=%s and add the keyword ex. Then instead of just opening the bookmark each time you would have to press Ctrl+L, Left, E, X, Space, Return to get the "ex " infront of the current url and open the bookmark.

Add-ons 😔

Probably there are lots of add-ons that could help here. (Maybe the Custom Buttons add-on?) But personally I wouldn't install just another add-on for this special purpose but instead re-use an (hopefully) already installed all-purposes add-on like Greasemonkey.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .