Last active
August 29, 2015 14:05
-
-
Save markd2/67f643e6cafdd95a7534 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
var ExtractSelectedText = function() {}; | |
ExtractSelectedText.prototype = { | |
run: function(options) { | |
var selectedText = "No Selection"; | |
if (window.getSelection) { | |
selectedText = window.getSelection().getRangeAt(0).toString(); | |
} else { | |
selectedText = document.getSelection().getRangeAt(0).toString(); | |
} | |
var results = { | |
"selectedText" : selectedText | |
}; | |
options.completionFunction(results); | |
}, | |
finalize: function(options) { | |
// This method is run after the native code completes. | |
} | |
}; | |
var ExtensionPreprocessingJS = new ExtractSelectedText |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment