bookmarklet

Combining Bookmarklets to create a toggle between HTTP and HTTPS?

和自甴很熟 提交于 2019-12-06 08:33:10
问题 By searching here, I now have two bookmarklets, which switch from/to HTTP/HTTPS :- javascript:location=location.href.replace(/http:/g,"https:") And ... javascript:location=location.href.replace(/https:/g,"http:") But is there a way, please, to combine them into a single bookmarklet, which will toggle from one to the other according to whichever is presently loaded? 回答1: This thread is a little old, but I haven't found a better answer anywhere else. javascript:((function(){window.location

bookmarklet that works on 2 pages

筅森魡賤 提交于 2019-12-06 07:23:54
问题 I'm using a bookmarklet to inject javascript into a webpage. I am trying to login into my gmail account(that part works) and in my gmail account automatically click Sent folder as the page loads. This is the starting page: This is the code I am using in bookmarklet: javascript: document.getElementById('Email').value='myEmail@gmail.com'; document.getElementById('next').click(); setTimeout(function(){ document.getElementById('Passwd').value='myPassword'; document.getElementById('signIn').click(

Change youtube video ID without page reloading

回眸只為那壹抹淺笑 提交于 2019-12-06 04:08:58
This question is about scripting the main youtube site, client side from javascript. While it looks easy as a click, I found no way to change the current video by a new non in context video ID without reloading. This seems to be related with the polymer library in use, with a lot of shadow dom and some special behavior. Here is the context: I am making for my own use a bookmarklet that load videos from the reddit json api , wich supports CORS calls. So far so good, I can load many videos, image previews and links into the youtube sidebar, with this simple enough handcrafted script. Bookmarklet

How to detach event in IE 6 7 8 9 using JavaScript

时光怂恿深爱的人放手 提交于 2019-12-06 02:43:16
问题 This is a partial code, not the full version. I have a highlighter that highlights a specific html element when the mouse hovers . I also have a click event and listener . My problem is : the highlighter event/listener does not detach when using Internet Explorer v6 v7 v8 v9 What am i doing wrong? this is how i attach the event and start the event listener: if (document.body.addEventListener) { //alert(11); document.body.addEventListener('mousemove', handler, false); } else if (document.body

Bookmarklet to save file

吃可爱长大的小学妹 提交于 2019-12-06 02:25:12
Is is possible to use a bookmarklet in Firefox to save/open a file directly? Many bookmarklets open a page on which one can click on a link to download the result. E.g. using a blob link. Is it possible to avoid this extra click and invoke the "save file" / "open file" dialog directly? To trigger the "Save As" dialog for any resource ( blob: , http: , whatever permitted scheme), use the download attribute of an anchor. This is supported since Firefox 20. Example: A bookmarklet that presents the current page as a download: javascript:(function() { var a = document.createElement('a'); a.href =

Javascript in a wordpress post

陌路散爱 提交于 2019-12-06 00:33:07
问题 how can I add <a href="javascript:function foo(){alert('hi');}" title="alert"> Drag to your bookmarks bar </a> in my wordpress post. I have built a bookmarklet and i want to pass it through my blog. But wordpress is stripping out the javascript from my post when it displays it. 回答1: I have no issues embedding that code in the HTML editor on my wordpress site. There is a problem with your javascript code- that defines a function, but never calls it. I have <a href="javascript:alert('hi');"

Creating thumbnail squares of images in javascript (without losing aspect ratio)

谁说胖子不能爱 提交于 2019-12-05 11:54:04
I am making a client side Drag and Drop file upload script as a bookmarklet. Before uploading I am using the File API to read the images into base64 format and display them as thumbnails. This is how my thumbnails look like. I want them to look more square but without loosing their aspect ratio. (please ignore progress bar) This is how I want the thumbnails to be like, they are centered and being cropped based on min(height,width). Can I do this using javascript only (changing styles via script will do)? Please try to make sure that your solution will fit with base64 images (after the images

Include external Javascript and CSS files into another site's DOM

廉价感情. 提交于 2019-12-05 08:08:39
问题 I am trying to load a Markdown editor like the one StackExchange uses on it's site into the Forrst.com site with a Bookmarklet or Browser Extension. Basically it looks like I need... Load the CSS file into the Page https://raw.github.com/ujifgc/pagedown/master/demo/browser/demo.css Load these 3 Javascript files into the page https://raw.github.com/ujifgc/pagedown/master/Markdown.Converter.js https://raw.github.com/ujifgc/pagedown/master/Markdown.Editor.js https://raw.github.com/ujifgc

How do I disable position:fixed in web pages?

丶灬走出姿态 提交于 2019-12-05 02:08:31
This website: http://nautil.us/ has a really annoying header that is always on screen and won't scroll away. If I right-click on it and 'inspect element' in firefox, then I find that the css contains "position: fixed;", and if I untick this, the header behaves, and scrolls away as God intended headers to do. Is there some way to get firefox to do this automatically, i.e. remove all position: fixed lines from all pages before rendering them? edit------- After a bit of thought, what I want is a bookmarklet that will kill off this sort of thing. So how to turn SciMonster's promising-looking: var

JavaScript : XPathEvaluator not supported in IE

本秂侑毒 提交于 2019-12-04 19:21:31
I have the following function in JavaScript , and it fails to run when using Internet Explorer . This function extract the value from a HTML tag , if a XPath is supplied. How can i replace this function, and with what ? function lookupElementByXPath(path) { var evaluator = new XPathEvaluator(); var result = evaluator.evaluate(path, document.documentElement, null,XPathResult.FIRST_ORDERED_NODE_TYPE, null); return result.singleNodeValue; } 来源: https://stackoverflow.com/questions/12927990/javascript-xpathevaluator-not-supported-in-ie