Skip to content

Instantly share code, notes, and snippets.

@voxpelli
Created September 7, 2014 14:17
Show Gist options
  • Save voxpelli/e64db6931a951b2d5181 to your computer and use it in GitHub Desktop.
Save voxpelli/e64db6931a951b2d5181 to your computer and use it in GitHub Desktop.
(function () {
if (window.parent !== window) {
window.parent.postMessage(JSON.stringify({
// The config of your endpoint
reply: 'http://voxpelli.com/reply?u={url}'
}), '*');
}
// Pick a way to invoke the registerProtocolHandler, through a submit handler in admin or something
document.getElementById('confForm').addEventListener('submit', function (e) {
e.preventDefault();
window.navigator.registerProtocolHandler('web+indie', '/?url=%s', 'Indie Config');
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment