Skip to content

Instantly share code, notes, and snippets.

@tily
Created June 22, 2009 01:34
Show Gist options
  • Save tily/133756 to your computer and use it in GitHub Desktop.
Save tily/133756 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name test
// @namespace http://www.example.com
// @description test
// @include *
// ==/UserScript==
if(!Minibuffer) return
$X = Minibuffer.$X
var only_images = function() {
ul = document.createElement('ul')
ul.style.listStyleType = 'none'
$X('//img').forEach(function(img){
li = document.createElement('li')
li.appendChild(img.cloneNode(true))
ul.appendChild(li)
})
serializer = new XMLSerializer()
str = serializer.serializeToString(ul)
console.log(str)
GM_openInTab([
'data:text/html;charset=utf8,<html><head></head><body>',
str,
'</body></html>'
].join(''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment