Created
September 7, 2014 14:17
-
-
Save voxpelli/e64db6931a951b2d5181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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