Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

1.9 Removing Applet Fallback

klabarge edited this page Jan 26, 2016 · 2 revisions

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.

  1. Remove the deployJava reference.

       <script type="text/javascript" src="js/3rdparty/deployJava.js"></script>
  2. 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;
  3. 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');
    }
  4. Remove the qzNoConnection body.

       //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.