bookmarklet

Using a bookmarklet to click Gmail's “Show original” button

喜欢而已 提交于 2019-12-24 13:15:46
问题 When I have an email open in Gmail, I'm trying to click the "Show original" dropdown menu item programmatically. The IDs of all the elements change dynamically with each email, so that's not a reliable way to find the menu item I'm trying to click. To start, I'm just trying to make a piece of JavaScript that clicks it in Chrome's console. After loading jQuery, I've tried this: jQuery('div[role=menuitem]:contains(Show original)').click(); While it seems to select the proper div and click it,

Get all scripts from external website

China☆狼群 提交于 2019-12-24 10:01:02
问题 I have a some code here and I with this code render external page (similar to iframe) but I got a source code. But when I start my code all is good but one window is showing there and I can't to close his to see contents. Here is the code: Code: <?php $url = 'http://www.kupime.com/'; $data = file_get_contents($url); $data = '<head><base href='.$url.' target="_blank" /></head>'.$data; echo $data; ?> and this generate a good HTML page but to close window I need also to get all scripts with this

Use Javascript Bookmarklet to Chunk Page Content by Headings (part 2)

佐手、 提交于 2019-12-24 07:08:33
问题 I've some javascript that @pimvdb helped me with here, and I was wondering if it could be tweaked so that it would group lesser heading's div 's within the next higher's div . In other words, start with this HTML: <p>Some paragraph</p> <h1>Heading 1</h1> <p>Some paragraph</p> <p>Some paragraph</p> <h2>Heading 2</h2> <p>Some paragraph</p> <p>Some paragraph</p> <h3>Heading 3</h3> <p>Some paragraph</p> <p>Some paragraph</p> <h1>Heading 1</h1> <p>Some paragraph</p> <p>Some paragraph</p> <h2

Create a link to a web page that runs a Javascript function on the page

别说谁变了你拦得住时间么 提交于 2019-12-24 01:26:02
问题 Using HTML and Javascript, is it possible to create a link to a web page that automatically runs a specific Javascript function on the web page (e. g., a bookmarklet)? I have a bookmarklet that highlights all matches of a regular expression, and I want to create a hyperlink to http://en.wikipedia.org that automatically runs the bookmarklet on http://en.wikipedia.org. 回答1: You could use something like GreaseMonkey or something equivalent for the browser your on. 回答2: This is pretty much the

In modern browsers, is there any security limitation for JavaScript bookmarklets?

大城市里の小女人 提交于 2019-12-24 00:29:22
问题 I read an article about bookmarklets which says that bookmarklets are so powerful they can be dangerous. For example, a malicious bookmarklet can collect your "cookies", "localStorage", the string in the password input box and then send it to a remote server, which is similar to "script injection". I'm curious about that. Since this article was written in 2007 (8 years ago), is there any limitation for bookmarklets (as well as browser plugins) to improve the security in modern browsers? 回答1:

Using localstorage in bookmarks

爷,独闯天下 提交于 2019-12-23 19:42:13
问题 I quite like using bookmarks with small scripts in them. For example, I have edited the note editing script from this post on Reddit to automatically save and load the last note via localstorage. ... window.addEventListener("load", function () { div.innerHTML = localStorage.getItem("note"); }, false); document.body.addEventListener("keyup", debounce(function () { localStorage.setItem("note", div.innerHTML); }, 760)); ... It runs fine if I open my html document as an actual html document

Is a javascript bookmarklet that can set domain cookies breaking cross-domain security?

﹥>﹥吖頭↗ 提交于 2019-12-22 18:39:33
问题 I am creating a bookmarklet that is to be used across a wide range of domains. I wanted to set some cookies to store temporary settings for this bookmarklet, so I assumed that setting a cookie from this script would assign the cookie to the domain of the script's origin. This was not the case, the bookmarklet is able to assign cookies to the domain of the current site being viewed. This is not suitable for my needs (this would remember settings per domain, rather than for the bookmarklet

JavaScript : XPathEvaluator not supported in IE

百般思念 提交于 2019-12-22 01:17:10
问题 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

How does Twitter for iPhone bookmarklet work?

会有一股神秘感。 提交于 2019-12-21 21:34:46
问题 Twitter client (formerly Tweetie) allows you to define a bookmarklet in Safari that launches the app. I want to know which iPhone API allows you to register the protocol specifier (or whatever it's called) - in this case "tweetie:" - in order for this bookmarklet to work. The instructions can be found here and the bookmarklet itself is below. javascript:window.location='tweetie:'+window.location Clicking the above bookmark is the same as typing in "tweetie:http://google.com" into the address

Create a Delicious Bookmarklet in Firefox using Delicious API

删除回忆录丶 提交于 2019-12-21 20:08:34
问题 I want to create a Delicious bookmarklet in Firefox that bookmarks the current page with a predefined tag. For proof of concept, if I enter this url, it works: https://john:pwd@api.del.icio.us/v1/posts/add?url=http://www.google.com& description=http://www.google.com&tags=testtag But this as a bookmarklet doesn't, I get access denied : javascript:( function() { location.href = 'https://john:pwd@api.del.icio.us/v1/posts/add?url=' + encodeURIComponent(window.location.href) + '&description=' +