bookmarklet

Reverting CSS style of <input type=submit button to its default style

断了今生、忘了曾经 提交于 2019-11-27 20:36:58
I'm using a bookmarklet that inserts a script tag into the current web page. This script has some UI and an " input type=submit.... " tag in it. Web page A has chosen not to style " input type=submit.. " tags whereas web page B has styled them. This results in the bookmarklet displaying differently styled submit buttons based on the underlying page's style. I want the submit buttons to be styled identically on all web pages in its default manner . One solution is to set the CSS style for the submit button within my script so it shows up identically on all pages. (This is what I have done for

Bookmarklet wait until Javascript is loaded

ぃ、小莉子 提交于 2019-11-27 18:02:08
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 javascript works in IE? (to contradict this post ) What's the simplest solution, cleanest resolution to

How to have favicon / icon set when bookmarklet dragged to toolbar?

巧了我就是萌 提交于 2019-11-27 16:53:22
I've made myself a bookmarklet, and it functions just fine, but when added to a toolbar in Opera or Firefox, it just takes on the default bookmark icon for the browser (a globe and a star, respectively). My site has a favicon, and the window, tab and even [site] bookmark uses the favicon I've specified. Just not my bookmarklet. How can I code my site or bookmarklet so that the bookmarklet gets the favicon, too? I'm aware of various manual hackery techniques users can use to set the favicon after the fact, but those are undesirable solutions. A bookmarklet uses the javascript:// schema and thus

Ajax call from Bookmarklet

限于喜欢 提交于 2019-11-27 15:10:22
问题 I am trying to create a bookmarklet that, upon clicking, would request some information from the user (a url and a couple other fields in this case) and then send that data to a php page on my server and then display the result. I would like to do an Ajax call for this so that I don't actually redirect to the new page, just get the data but I assume I would run into the "Same Origin Policy" limitation of Ajax.... is there any known way of basically doing the same thing? Also, what would be

How can I get the element in which highlighted text is in?

可紊 提交于 2019-11-27 14:04:14
I am trying to learn how to write a bookmarklet where I can highlight some text, click on the bookmarklet and have it tell me what got highlighted. I can get that far, but next I want to know what element that text is in. For example: <div id="some-id">to be highlighted</div> The bookmarklet code: javascript:(function(){alert(window.getSelection();})() If I highlight the text "to be highlighted" and then click on the bookmarklet, it will alert the text. But how can I get the element in which the text is in, in this case the element after that? So the flow is: highlight text, click bookmarklet,

Load a page and apply javascript in a single bookmark

北城余情 提交于 2019-11-27 08:38:01
问题 I have a bookmark that opens my a google calendar page (http://www.google.com/calendar/renderOnline) and a bookmarklet that applies some javascript on it: javascript:document.getElementById('gadgetcell').setAttribute('style','width:300px');document.getElementsByClassName('sn-frame')[0].setAttribute('style','width:300px'); Is there a way to combine these into a single bookmarklet so that i don't have to click twice all the time? Thank you! 回答1: You could use an extension to get the same

JavaScript: Invert color on all elements of a page

折月煮酒 提交于 2019-11-27 06:05:23
Note: I am keeping an up-to-date version of the bookmarklet in my question which works well and is based on Jacob's answer. If you are looking for a bookmarklet to use, use that one. See leosok's fantastic answer if you just want something amazing that works on chrome. I want to be able to invert the color of all the elements on a page with a JavaScript bookmarklet. I know that to invert a color you subtract each of the RGB hex values from 255(xFF), but beyond that I am unsure of how to proceed. How can I accomplish this? Using jQuery is acceptable, and it only needs to work on Chrome,

Identify & Extract the title/description of an Image (Data Scraping Pinterest)

风流意气都作罢 提交于 2019-11-27 05:48:07
问题 How can Javascript/jQuery be used to identify the description or title corresponding to an image on a webpage with multiple images and descriptions? The page title can be extracted very easily, but the title may not correspond to the image especially if there are many images present on the page var title = document.title; I believe this has been done successfully by Pinterest's Pin-it bookmarklet. I'm guessing it has to do with an algorithm to find the nearest h1 , h2 , h3 or the image's alt

Add a bookmark that is only javascript, not a URL

混江龙づ霸主 提交于 2019-11-27 05:29:24
问题 I'm thinking that the reason I can't do this is because it might be a huge security hole, but here goes... I want to have a bookmark on my browser (FF3, preferably) that is only a snippet of javascript code. It would merely construct a URL based on the current date and then do a window.location = on that URL. I know that I could make a page and keep it on my local machine and just refer to it that way, but I was just wondering if you could bypass that step and actually have the "location" of

scripting a google docs form submission

本小妞迷上赌 提交于 2019-11-27 05:18:35
问题 I'm trying to create a bookmarklet that parses a page and sends the results to a googledocs spreadsheet via a form that I've defined. The relevent bit of the script is: var form = document.createElement("form"); form.action = "http://spreadsheets.google.com/formResponse?formkey=Fd0SHgwQ3YwSFd5UHZpM1QxMlNOdlE6MA&ifq"; form.method = "POST"; form.id="ss-form"; form.innerHTML = ["<input id='entry_0' name = 'entry.0.single' value = '" + orderDate + "'/>", "<input name = 'entry.2.single' value = '"