Skip to content

Instantly share code, notes, and snippets.

@blork
Created September 5, 2014 19:58
Show Gist options
  • Save blork/e2780fd7e2a1a95f57d3 to your computer and use it in GitHub Desktop.
Save blork/e2780fd7e2a1a95f57d3 to your computer and use it in GitHub Desktop.
iOS Extension Web Page Preprocessor
var MyPreprocessor = function() {};
MyPreprocessor.prototype = {
run: function(arguments) {
// Pass the baseURI of the webpage to the extension.
arguments.completionFunction({"URL": document.URL, "pageSource": document.documentElement.outerHTML, "title": document.title, "selection": window.getSelection().toString()});
}
};
// The JavaScript file must contain a global object named "ExtensionPreprocessingJS".
var ExtensionPreprocessingJS = new MyPreprocessor;
@ylovesy
Copy link

ylovesy commented Nov 4, 2014

Is it a way to get the logo image source?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment