1.9 Removing Applet Fallback - qzind/qz-print GitHub Wiki
- ⛔ 2.x | ✅ 1.9 | ...
By default, the QZ Tray sample.html is designed to fallback on QZ Print (the legacy applet version) if the plugin is found in the browser. This code can be easily removed to get rid of this feature if you find it unnecessary.
-
Remove the
deployJavareference.<script type="text/javascript" src="js/3rdparty/deployJava.js"></script>
-
Remove the
window["deployQZ"]line and comments./** * Re-use the new WebSockets deployment if available. If not, fallback on the Oracle deployment */ window["deployQZ"] = typeof(deployQZ) == "function" ? deployQZ : deployQZApplet;
-
Remove the
deployQZApplet()function.function deployQZApplet() { console.log('Starting deploy of qz applet'); var attributes = {id: "qz", code:'qz.PrintApplet.class', archive:'../qz-print.jar', width:1, height:1}; var parameters = {jnlp_href: '../qz-print_jnlp.jnlp', cache_option:'plugin', disable_logging:'false', initial_focus:'false', separate_jvm:'true'}; if (deployJava.versionCheck("1.7+") == true) {} else if (deployJava.versionCheck("1.6.0_45+") == true) {} else if (deployJava.versionCheck("1.6+") == true) { delete parameters['jnlp_href']; } deployJava.runApplet(attributes, parameters, '1.6'); }
-
Remove the
qzNoConnectionbody.//run deploy applet After page load var content = ''; var oldWrite = document.write; document.write = function(text) { content += text; }; deployQZApplet();
After removing these lines, QZ Tray will no longer try to fallback on QZ Print.