<commit_before>if (DepthJS) {
console.log("DepthJS Loading Safari shit");
DepthJS.initBrowserBackground = function() {
  console.log("DepthJS: Initing Safari background");
  DepthJS.toolbar.init = function() {

    var modes = ["PannerMode", "SelectorBoxMode", "DepthoseMode"];
    var index = 0;

    safari.application.addEventListener("command", function(msgEvent) {
      if (msgEvent.command == "toolbarClick") {
        var mode = index % 3;
        console.log(["Toolbar clicked, entering mode", mode]);
        DepthJS.test.runTestSequence([{type:modes[mode], data:{}}]);
        index++;

        // msgEvent.target.image = safari.extension.baseURI + "alpha_background.gif";
        // event.target.browserWindow
        // DepthJS.test.gestureTest();
      }
    });
  };<commit_msg>Safari should use the plugin backend<commit_after>if (DepthJS) {
console.log("DepthJS Loading Safari shit");
DepthJS.initBrowserBackground = function() {
  console.log("DepthJS: Initing Safari background");
  // Choose the NPAPI-based backend
  DepthJS.backend.connect = DepthJS.npBackend.connect;
  DepthJS.backend.disconnect = DepthJS.npBackend.disconnect;

  DepthJS.toolbar.init = function() {

    var modes = ["PannerMode", "SelectorBoxMode", "DepthoseMode"];
    var index = 0;

    safari.application.addEventListener("command", function(msgEvent) {
      if (msgEvent.command == "toolbarClick") {
        var mode = index % 3;
        console.log(["Toolbar clicked, entering mode", mode]);
        DepthJS.test.runTestSequence([{type:modes[mode], data:{}}]);
        index++;

        // msgEvent.target.image = safari.extension.baseURI + "alpha_background.gif";
        // event.target.browserWindow
        // DepthJS.test.gestureTest();
      }
    });
  };
{'fraction_non_alphanumeric': 0.14699205448354144, 'fraction_numerical': 0.0022701475595913734, 'mean_word_length': 3.418546365914787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3867504', 'n_tokens_mistral': 534, 'n_tokens_neox': 513, 'n_words': 101}