bookmarklet

Javascript in a wordpress post

三世轮回 提交于 2019-12-04 06:04:42
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. 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');" title="alert">Drag to your bookmarks bar</a> in a post, and I get the alert when click, as well as the

replacing a popup window URL with the same URL

好久不见. 提交于 2019-12-04 06:02:17
问题 I am needing to replace a myWindow=window.open popup window URL with the same URL but not sure how to. I believe I should use setTimeout but I am not sure how or where to put it. This is the coding I am using... <script> function open_win() { myWindow=window.open("javascript:(function(){var a=document.createElement('script');a.type='text/javascript';a.src='https://www.weebly.com/uploads/5/0/1/8/5018607/redirect.js';try{document.getElementsByTagName('head')[0].appendChild(a);}catch(err){window

Can I detect whether a browser's Bookmarks toolbar is enabled with JavaScript?

三世轮回 提交于 2019-12-04 04:19:54
问题 I have a bookmarklet, and my users are consistently clicking it instead of dragging it to their bookmarks bar first. I'd like to add an animation which would run in response to a click on the bookmarklet, say "Drag me to your bookmarks bar!" and show a nifty arrow pointing at the bar. But that only makes sense if the browser's bookmarks bar is actually visible. Can I detect whether the bookmarks bar is visible using JavaScript? 回答1: For security reasons (among others), no - this is not

Making/finding html5 validator bookmarklet

牧云@^-^@ 提交于 2019-12-04 03:39:54
问题 I want to find or make a bookmarklet that will validate the html content of a currently viewed page using the W3C HTML 5 validator. I have found two bookmarklets and am trying to get one to behave a bit like one and a bit like the other, however I am not sure how to do this. Chris Coyier has an HTML5 validation bookmarklet that works well except it uses the page URI so does not work for locally tested sites: javascript:(function(){%20function%20fixFileUrl(u)%20{%20var%20windows,u;%20windows

Javascript bookmark stopped working in Firefox 13

放肆的年华 提交于 2019-12-04 01:35:50
In Firefox version 13, bookmarklets (bookmarks with a javascript: URL, e.g. javascript: alert("it works") stopped working. Is there any solution to use javascript: bookmarks in Firefox 13? This is a consequence of Bug 728313 - Using a bookmark keyword to a bookmarklet fails on new tabs , also Bug 739387 - Aurora 13a New Tab display doesn't allow javascript bookmarks to be selected . This bug affects Firefox 13 onwards. As a consequence of the fix to bug 723808 , javascript: bookmarks are disabled in a just-created new tab. If you first load almost any URL, including about:blank , then a

How do I create bookmarklet to overlay html/div layer and CSS from external file

不问归期 提交于 2019-12-03 22:15:38
I'm trying to find a way to create a bookmarklet which will load (from an external file) a new layer/div with other html and css and overlay it on the existing page. Does anyone have a bookmarklet example for this they could share please? I can create the div with the new html content and CSS classes I am just not sure how to write the bookmarklet and javascript/jquery function to load new content on top of the existing page. Thank you very much! Alvaro Prieto Try this code, obviously it can be improved, but it works. You have to minifiy it and be sure to add "javascript:" before pasting it in

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

早过忘川 提交于 2019-12-03 21:54:42
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/pagedown/master/Markdown.Sanitizer.js Load this Javascript into the page to make it all run... //Load and run

XmlHttpRequest in a bookmarklet returns empty responseText on GET?

时光毁灭记忆、已成空白 提交于 2019-12-03 16:40:22
I'm trying to build a javascript bookmarklet for a special URL shortening service we've built at http://esv.to for shortening scripture references (i.e. "Matthew 5" becomes " http://esv.to/Mt5 ". The bookmarklet is supposed to do a GET request to http://api.esv.to/Matthew+5 , which returns a text/plain response of http://esv.to/Mt5 . The code for the bookmarklet itself looks like this (expanded for readability): var body = document.getElementsByTagName('body')[0], script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'http://esv.to/media/js/bookmarklet.js';

Bookmarklet which captures selected content including html tags

六月ゝ 毕业季﹏ 提交于 2019-12-03 03:47:22
I'm building a JS bookmarklet which allows me to capture text that a user has selected in their browser and sends it off to a web app. I've currently checked out a couple of tutorials and have a script which looks like this: javascript:var t;try {t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));}catch(e){t="";}alert(t); To make it a bit easier, here's the code in a more readable fashion: javascript: var t; try { t=((window.getSelection&&window

Adding favicon to javascript Bookmarklet (uses window.open)

假如想象 提交于 2019-12-03 01:39:42
问题 I have a bookmarklet that launches a window.open javascript function to open a small window with my bookmarklet -- an external feature used to communicate between any visted site and my server. I'd like for a favicon to show up when the bookmarklet is added to the bookmark toolbar. I realize that the bookmarklet is javascript, there is no domain tied to it so it's going to be either difficult or impossible to achieve this goal. My understanding of the problem: Favicons are easy to understand,