0.3.11 • Published 4 years ago
iframe-hash-manager v0.3.11
iframe-hash-manager
Tiny library to effortlessly sync a window's location hash with the hashes of multiple iframes in the site.
Usage
Note: Currently, changes in the master hash will not be reflected in the iframes. Iframes will only be initialized once with the master hash.
As script from dist/iframeHashManager.js
:
<iframe id="facebook-killer" class='spa'></iframe>
<iframe id="instagram-killer" class='spa'></iframe>
<script src="js/iframeHashManager.js"></script>
<script >iframeHashManager(window)</script>
As ES5 module. The second parameter is optional. The options shown below are the defaults.
yarn add iframe-hash-manager
var iframeHashManager = require('iframe-hash-manager')
iframeHashManager({
context: window, // you can pass any context, but context MUST be a window object
selector: 'iframe', // document.querySelectorAll is used internally
// https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll
id: iframe => iframe.id // The function used to generate the iframe id
// This should be deterministic if you want share-able links
})
or as ES6 module.
import iframeHashManager from 'iframe-hash-manager'
iframeHashManager() // Defaults as above
Good Luck!
Development
Take a look at the package.json
to find the scripts that may be useful for development.
0.3.11
4 years ago
0.3.10
4 years ago
0.3.9
5 years ago
0.3.8
5 years ago
0.3.7
6 years ago
0.3.6
7 years ago
0.3.5
7 years ago
0.3.4
7 years ago
0.3.3
7 years ago
0.3.2
7 years ago
0.3.1
7 years ago
0.3.0
7 years ago
0.2.3
7 years ago
0.2.2
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.0
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago