Skip to content

Instantly share code, notes, and snippets.

@mrkev
Created February 23, 2013 06:11
Show Gist options
  • Save mrkev/5018658 to your computer and use it in GitHub Desktop.
Save mrkev/5018658 to your computer and use it in GitHub Desktop.
Requires the URL calls to be intercepted from the WebView. See https://gist.github.com/mrkev/4602188
App = new Object();
// Send message to application
// with the format osx:selector:attr1:attr2:etc...
App.sel = function (sel){
var iframe = document.createElement('iframe');
iframe.setAttribute('src', 'osx:' + sel);
document.documentElement.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
iframe = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment