Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mtrunkat/bookmarklet

Simple javascript bookmarklet browser icon
https://github.com/mtrunkat/bookmarklet

bookmarklet browser javascript

Last synced: 6 days ago
JSON representation

Simple javascript bookmarklet browser icon

Awesome Lists containing this project

README

        

# Bookmarklet

Code is based on the Bookmarklet module https://drupal.org/project/bookmarklet for Drupal by Benjamin Doherty. It's completely rewritten to work without dependencies like jQuery and jQuery UI. It also creates just plain iframe inside of the parent site to minimalize the probability of CSS conflicts.

## Overview

This bookmarklet can be simply used at any site. Users can drag and drop the Bookmarklet button to his browser bar.

![alt text](./img/img.jpg)

When he clicks at the button, an iframe is created inside of the DOM of the current site pointing to the given URL. Url, title and images from the current site are passed to the iframe as GET parameters.

![alt text](./img/img2.jpg)

## Configuration

All you have to do is to configure the properties of settings object:

| Property | Type | Description |
| ------------- |:-------------:|-------------|
| url | string | full url to be opened in iframe |
| url_js | string | full url of bookmarklet.js file |
| css_iframe | string | css of iframe |
| css_overlay | string | css of page url |
| image | boolean | if we want to look for images contained in site |
| image_width | integer | minimal width of images |
| image_height | integer | minimal height of images |

And here is the full code of the bookmarklet button (for details see example.html):

```html
Drag and drop this button to your browser bar.
```

The bookmarklet can be closed from iframe via following call (works in modern browsers only):

window.parent.postMessage('close', '*');