https://github.com/ticky/bookmarklets
📑 A collection of handy bookmarklets
https://github.com/ticky/bookmarklets
Last synced: 14 days ago
JSON representation
📑 A collection of handy bookmarklets
- Host: GitHub
- URL: https://github.com/ticky/bookmarklets
- Owner: ticky
- License: mit
- Created: 2016-05-04T18:48:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-04T18:52:42.000Z (about 10 years ago)
- Last Synced: 2025-02-23T04:16:46.659Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# Bookmarklets
A collection of Bookmarklets
## List
* [960ify](#960ify)
* [Meta Snooper](#meta-snooper)
* [Viewport Breakers](#viewport-breakers)
## Bookmarklets
### 960ify
A quick bookmarklet for making fluid-width webpages 960px wide for readability.
Useful for MSDN and other documentation sites, especially where tables are used which Instapaper can't deal with.
```javascript
javascript:!function(a){a.style.margin="0 auto",a.style.width="960px"}(document.getElementsByTagName("body")[0]);
```
### Meta Snooper
Quickly grabs important meta content from the current page, including;
* Open Graph tags
* Description
* Keywords
```javascript
javascript:!function(a){for(var b=["Meta Snooper:"],c=0;c1?alert(b.join("\n \u2022 ")):alert("No important meta tags were found.")}(document.querySelectorAll("meta[property^='og:'], meta[name='description'], meta[name='keywords']"));
```
_*Note*: Requires a browser which has `document.querySelectorAll`._
### Viewport Breakers
Bookmarklet to detect elements which force the page outside the viewport.
Currently does not attempt to determine if an element is not able to be causing a problem due to its parents `overflow`. You have to do at least some of the work.
```javascript
javascript:!function(a){function c(){return a.width>a.documentElement.clientWidth}function d(b){return b.offsetLeft+b.offsetWidth>a.documentElement.clientWidth}function e(b){var c=b.tagName.toLowerCase();""!==b.id&&(c=[c,b.id].join("#")),b.classList&&b.classList.length>0&&(c=[c,b.className.replace(" ",".")].join("."));var d=a.body.querySelectorAll(c.replace(/\//g,"\\/"));if(d&&d.length>1)for(var f=0;f0?alert([["\u26a0",g.length.toString(),"elements appear to overflow the page;"].join(" "),g.join("\n \u2022 ")].join("\n \u2022 ")):alert([b?"\u26a0 ":"","No elements appear to overflow the page, but the document is wider than the viewport."].join(""))}else alert([b?"\uf44d ":"","Document does not appear to overflow the viewport.\nYou're all good."].join(""))}(document);
```
## Legal
Copyright © 2013 Jessica Stokes. Please see `license.txt`.