bookmarklet

Sending Text Cross Domain By Bookmarklet

守給你的承諾、 提交于 2019-12-18 02:58:20
问题 I need a user to navigate to a certain page that has a certain div full of useful text. Then click my bookmarklet and send the text in that div back to my server, which is different from the current domain. I have successfully inserted jQuery on the bookmarklet click and selected the text. Now I need to figure out a way to send that text cross domain to my server. I tried JSONP with jQuery and my text is too long for the url. My second idea was to open up a new window and load a page from my

How to remove 'http://' from a URL in JavaScript [duplicate]

寵の児 提交于 2019-12-17 22:13:03
问题 This question already has answers here : taking off the http or https off a javascript string (12 answers) Closed 3 years ago . I have run into an odd situation. I'm writing a JavaScript bookmarklet that will allow users to click and share external websites to our website very easily and quickly. It simply get's the title, page URL, and if they've selected any text on the page, it grabs it too. The problem is it doesn't work with external domains for some reason, so if we use it internally we

Bookmarklet wait until Javascript is loaded

ⅰ亾dé卋堺 提交于 2019-12-17 15:25:41
问题 I've got a bookmarklet which loads jQuery and some other js libraries. How do I: Wait until the javascript library I'm using is available/loaded. If I try to use the script before it has finished loading, like using the $ function with jQuery before it's loaded, an undefined exception is thrown. Insure that the bookmarklet I load won't be cached (without using a server header, or obviously, being that this is a javascript file: a metatag ) Is anyone aware if onload for dynamically added

Firefox Bookmarklet: Exposing functions to the global namespace

烂漫一生 提交于 2019-12-13 16:20:06
问题 I'm working on a moderately-complex Bookmarklet that works just fine in Chrome, but I can't get it to work in Firefox. When I run my Bookmarklet in Firefox it redirects to a new page that only says true on it. I've narrowed the cause down to a very specific thing: Firefox doesn't seem to like when you expose new functions to the global namespace. If this is the case, might you know more about it? Is this documented anywhere, such that I can learn more about it? Resources on the nuances of

A bookmarklet that adds an onclick event to every element on the page?

纵然是瞬间 提交于 2019-12-13 08:56:04
问题 I want to make bookmarklet, and when you press it all the elements on the page gets an onclick event that calls a function with the element as a parameter or at least the elements id/class/something, is that possible? In that case, how would I do it? 回答1: click bubbles. So just bind to the <body> and check what the target of the event element is (you'll need to do a bit of event normalization to get around IE being different from everyone else.) event.target is the actual DOM element, so you

When is it necessary to escape a JavaScript bookmarklet?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 04:52:55
问题 Bookmarklets I've made seem to always work well even though I don't escape them, so why do bookmarklet builders like John Gruber's escape special characters like space to %20 ? 回答1: If you copy/paste code into a bookmark using the browsers bookmark properties editor, you don't need to encode anything except newlines and percent signs. But, in fact, Firefox (and maybe other browsers) will encode spaces for you. If you check the properties again after saving, you'll see them encoded. You need

Create a Bookmarklet that clicks multiple buttons on one page

霸气de小男生 提交于 2019-12-13 04:45:24
问题 I created a bookmarklet for a site a while back that ticks multiple checkboxes on a page: javascript:javascript:;$("input[name='unfollow[]']").attr({checked:true}); Unfortunately the UI has changed and instead of checkboxes there are buttons that need to be clicked. Here is an example of the HTML of one of the buttons: <button class="process mode-basic Unfollow" data-verb="unfollow">Unfollow</button> There can be up to 100 of these buttons. How do I create a bookmarklet that clicks all of

Make A Bookmarklet Execute A Function That It Downloads

自闭症网瘾萝莉.ら 提交于 2019-12-13 04:31:13
问题 I would like to create a bookmarklet that downloads a remote javascript file in which a function is defined and then executes that function with parameters that are hard-coded into the bookmarklet. Here is your standard "download-and-run-remote-script" bookmarklet with an extra function call in the last line: javascript:( function () { var new_script = document.createElement("script"); new_script.src = "http://mydomain.com/myscript.js"; document.body.appendChild(new_script); do_stuff('Hello

Bookmarklet to refresh page every minute or so, so I don't lose session data whilst on lunch

ぃ、小莉子 提交于 2019-12-13 04:18:22
问题 I've just entered a load of data into a site that I'm testing. I don't want to enter it again, but want to go for lunch, and the session will have expired by the time I get back. A bookmarklet would be handy (as this situation occurs often) to keep refreshing the page, every minute or so. Any ideas? Thanks. 回答1: Use the ReloadEvery plugin to Firefox. 回答2: This bookmarklet reloads the page every 5min, almost certainly keeping the session active as if you had just opened a new tab; the trick is

Open url in same tab AND 'document.write' after

有些话、适合烂在心里 提交于 2019-12-13 01:09:44
问题 Half of my question was answered with this. I need to open another url (or replace location/href/src, whatever) in the current tab and after that inject HTML via document.write (or innerHTML , whatever) into the new page. The code will be used in a Chrome bookmarklet which will open an enhanced version of the new page. Here is what I got so far: javascript: window.open('https://stackoverflow.com/','_self').document.write('Page Booster 3000'); Any thoughts are appreciated. P.S 1: the code