Skip to content

Instantly share code, notes, and snippets.

@foloinfo
Last active February 13, 2017 06:35
Show Gist options
  • Save foloinfo/ad0672f752e12d35d447b6e857b16d40 to your computer and use it in GitHub Desktop.
Save foloinfo/ad0672f752e12d35d447b6e857b16d40 to your computer and use it in GitHub Desktop.
if (WebViewBridge) {
document.addEventListener('selectionchange', function(){
var body = document.getSelection().toString();
var object = { "type": "select", body: body }
WebViewBridge.send(JSON.stringify(object));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment