Files
omnivore/apple/Sources/ShareExtension/ShareExtension.js
Jackson Harper a02bb2f5c9 Extract contentType from safari
This fixes issues where we'd incorrectly identify a PDF as HTML.
Safari will use our preprocess javascript file even if the
file is PDF, so we rely on JS to detect the content type here.
2022-05-24 21:01:04 -07:00

15 lines
418 B
JavaScript

var ShareExtension = function() {};
ShareExtension.prototype = {
run: function(arguments) {
arguments.completionFunction({
'url': window.location.href,
'title': document.title.toString(),
'contentType': document.contentType,
'documentHTML': new XMLSerializer().serializeToString(document),
});
}
};
var ExtensionPreprocessingJS = new ShareExtension();