capacitor-webview-print
Version:
This is a Capacitor plugin for printing the webview. It supports the Web, iOS and Android Platform.
28 lines (21 loc) • 805 B
JavaScript
var capacitorWebviewPrint = (function (exports, core) {
'use strict';
const WebviewPrint = core.registerPlugin('WebviewPrint', {
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.WebviewPrintWeb()),
});
class WebviewPrintWeb extends core.WebPlugin {
async print(options) {
const documentTitleTemp = document.title;
document.title = options.name;
window.onafterprint = () => (document.title = documentTitleTemp);
return window.print();
}
}
var web = /*#__PURE__*/Object.freeze({
__proto__: null,
WebviewPrintWeb: WebviewPrintWeb
});
exports.WebviewPrint = WebviewPrint;
return exports;
})({}, capacitorExports);
//# sourceMappingURL=plugin.js.map