google-chromesafariios8-share-extension

iOS share extension in chrome


Just added share extension to my app. It's working fine in safari. When launching it from Chrome the "ExtensionPreprocessingJS.js" isn't called. as a result the following code is not invoked:

MyExtensionJavaScriptClass.prototype = {
run: function(arguments) {
    // Pass the baseURI of the webpage to the extension.
    arguments.completionFunction({"baseURI": document.baseURI});
},

Please advise.


Solution

  • That behavior is documented as being a Safari option, not something that applies to every web browser.

    In Share extensions (on both platforms) and Action extensions (iOS only), you can give users access to web content by asking Safari to run a JavaScript file and return the results to the extension.

    [Emphasis mine]