Clear History Box - Opens Incorrectly

The place to report Pale Moon specific bugs on Linux and other operating systems.
Locked
User avatar
fatboy
Lunatic
Lunatic
Posts: 307
Joined: 2017-12-19, 08:03

Clear History Box - Opens Incorrectly

Post by fatboy » 2020-04-06, 09:37

Good Day,

I have reported this same error with Basilisk, but encountered it today on Palemoon 28.9.0.2 for Linux (PCLINUXOS). I have attached some screenshots and error console output:
Palemoon_Clear_History_ERror.png
Palemoon_Clear_History_Error_Console.png
Palemoon_Clear_History_Error_Console_Messages.png

Code: Select all

    menu.appendChild(popup.cloneNode(true));
  }
}
function stitch_context_menu2() {
  // the same menu appears both under Tools and via the toolbar button:
  var menu = document.getElementById("https-always-menu2");
  if (!menu.firstChild) {
    var popup = document.getElementById("https-always-context");
    menu.appendChild(popup.cloneNode(true));
  }
}

function show_applicable_list(menupopup) {
  var browser = httpsAlways.toolbarButton.selectedBrowser();
  if (!browser) {
    HTTPSAlways.log(WARN, "No browser for applicable list");
    return;
  }

  var alist = HTTPSAlways.getExpando(browser,"applicable_rules");
  var weird=false;

  if (!alist) {
    // This case occurs for error pages and similar.  We need a dummy alist
    // because populate_menu lives in there.  Would be good to refactor this
    // away.
    alist = new HTTPSAlways.ApplicableList(HTTPSAlways.log, browser.currentURI);
    weird = true;
  }
  alist.populate_menu(document, menupopup, weird);
}

function toggle_rule(rule_id) {
  // toggle the rule state
  HTTPSAlways.https_rules.rulesetsByID[rule_id].toggle();
  reload_window();
}

function reload_window() {
  var browser = httpsAlways.toolbarButton.selectedBrowser();
  if (browser) {
    browser.reload();
  }
}

function toggleEnabledState(){
  HTTPSAlways.toggleEnabledState();
  reload_window();
  toggleEnabledUI();
}

function toggleEnabledUI() {
  // Add/remove menu items depending on whether HTTPS-E is enabled
  var items = document.querySelectorAll(".hide-on-disable");
  var enabled = HTTPSAlways.prefs.getBoolPref("globalEnabled");
  for (let i = 0; i < items.length; i++) {
    items[i].hidden = !enabled;
  }

  httpsAlways.toolbarButton.updateIconState();
}

function open_in_tab(url) {
  let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
  browserWindow.gBrowser.addTab(url, {
          triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
        });
}

function httpse_chrome_opener(url, prefs) {
  HTTPSAlways.chrome_opener(url, prefs);
}

// hook event for showing hint
HTTPSAlways.log(DBUG, 'Adding listener for toolbarButton init.');
window.addEventListener("load", httpsAlways.toolbarButton.init, false);

function migratePreferences(gBrowser) {
  gBrowser.removeEventListener("DOMContentLoaded", migratePreferences, true);
  let prefs_version = HTTPSAlways.prefs.getIntPref("prefs_version");

  // first migration loses saved prefs
  if(prefs_version == 0) {
    try {
      // upgrades will have old rules as preferences, such as the EFF rule
      let upgrade = false;
      let childList = HTTPSAlways.prefs.getChildList("", {});
      for(let i=0; i<childList.length; i++) {
        if(childList[i] == 'EFF') {
          upgrade = true;
          break;
        }
      }

      if(upgrade) {
        let nBox = gBrowser.getNotificationBox();
        let strings = document.getElementById('HttpsAlwaysStrings');
        let msg = strings.getString('https-always.migration.notification0');
        nBox.appendNotification(
          msg, 
          'https-always-migration0', 
          'chrome://https-always/skin/icon-active-24.png', 
          nBox.PRIORITY_WARNING_MEDIUM
        );
      }
    } catch(e) {
      HTTPSAlways.log(WARN, "Migration from prefs_version 0 error: "+e);
    }

    HTTPSAlways.prefs.setIntPref("prefs_version", prefs_version+1);
  }
}
Systemd Free - MX Linux & Artix Linux

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Clear History Box - Opens Incorrectly

Post by adesh » 2020-04-06, 10:11

From the error screenshot it seems the problem is with HTTPS Always extension. If you click on the error, you will be taken to the exact code location where the error occurs. Then you can fix it.

Locked