Commit 11c13def authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

BB 44045: Disable ML features.

parent b7eb2601
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1072,10 +1072,7 @@ var gBrowserInit = {
      ToolbarKeyboardNavigator.uninit();
    }

    // Bug 1952900 to allow switching to unload category without leaking
    ChromeUtils.importESModule(
      "moz-src:///browser/components/genai/LinkPreview.sys.mjs"
    ).LinkPreview.teardown(window);
    // LinkPreview.sys.mjs is missing. tor-browser#44045.

    FirefoxViewHandler.uninit();

+10 −16
Original line number Diff line number Diff line
@@ -15,8 +15,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
    "resource://gre/modules/ContextualIdentityService.sys.mjs",
  DevToolsShim: "chrome://devtools-startup/content/DevToolsShim.sys.mjs",
  E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs",
  GenAI: "resource:///modules/GenAI.sys.mjs",
  LinkPreview: "moz-src:///browser/components/genai/LinkPreview.sys.mjs",
  // GenAI.sys.mjs and LinkPreview.sys.mjs are missing. tor-browser#44045.
  LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs",
  LoginManagerContextMenu:
    "resource://gre/modules/LoginManagerContextMenu.sys.mjs",
@@ -596,10 +595,8 @@ export class nsContextMenu {
      shouldShow && !isWindowPrivate && showContainers
    );
    this.showItem("context-openlinkincurrent", this.onPlainTextLink);
    this.showItem(
      "context-previewlink",
      lazy.LinkPreview.shouldShowContextMenu(this)
    );
    // LinkPreview.sys.mjs is missing. tor-browser#44045.
    this.showItem("context-previewlink", false);
  }

  initNavigationItems() {
@@ -953,12 +950,10 @@ export class nsContextMenu {

    this.showAndFormatSearchContextItem();
    this.showTranslateSelectionItem();
    lazy.GenAI.buildAskChatMenu(document.getElementById("context-ask-chat"), {
      browser: this.browser,
      selectionInfo: this.selectionInfo,
      showItem: this.showItem.bind(this),
      source: "page",
    });
    // GenAI.sys.mjs is missing. tor-browser#44045.
    // Need to remove the element from the DOM since otherwise it will cause an
    // error due to `.menupopup === null`.
    document.getElementById("context-ask-chat")?.remove();

    // srcdoc cannot be opened separately due to concerns about web
    // content with about:srcdoc in location bar masquerading as trusted
@@ -2287,10 +2282,9 @@ export class nsContextMenu {
    );
  }

  previewLink(url = this.linkURL) {
    // If we're in a view-source tab, remove the view-source: prefix
    url = url.replace(/^view-source:/, "");
    lazy.LinkPreview.handleContextMenuClick(url, this);
  previewLink(_url = this.linkURL) {
    // LinkPreview.sys.mjs is missing. Unexpected to reach here since
    // #context-previewlink is hidden. tor-browser#44045.
  }

  /**
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ category browser-window-domcontentloaded moz-src:///browser/components/customiza

category browser-window-delayed-startup moz-src:///browser/components/contentanalysis/content/ContentAnalysis.sys.mjs ContentAnalysis.initialize
category browser-window-delayed-startup resource:///modules/HomePage.sys.mjs HomePage.delayedStartup
category browser-window-delayed-startup moz-src:///browser/components/genai/LinkPreview.sys.mjs LinkPreview.init
# LinkPreview.sys.mjs is missing. tor-browser#44045.
category browser-window-delayed-startup moz-src:///browser/components/reportbrokensite/ReportBrokenSite.sys.mjs ReportBrokenSite.init
category browser-window-delayed-startup moz-src:///browser/components/search/SearchUIUtils.sys.mjs SearchUIUtils.init
category browser-window-delayed-startup resource:///modules/taskbartabs/TaskbarTabsPageAction.sys.mjs TaskbarTabsPageAction.init
@@ -60,7 +60,7 @@ category browser-idle-startup resource:///modules/BuiltInThemes.sys.mjs BuiltInT
category browser-idle-startup resource://gre/modules/RFPHelper.sys.mjs RFPHelper.init
category browser-idle-startup resource://gre/modules/Blocklist.sys.mjs Blocklist.loadBlocklistAsync
category browser-idle-startup moz-src:///browser/components/tabbrowser/TabUnloader.sys.mjs TabUnloader.init
category browser-idle-startup resource:///modules/GenAI.sys.mjs GenAI.init
# GenAI.sys.mjs is missing. tor-browser#44045.
category browser-idle-startup resource:///modules/QuickSuggest.sys.mjs QuickSuggest.init
category browser-idle-startup resource:///modules/UrlbarSearchTermsPersistence.sys.mjs UrlbarSearchTermsPersistence.init
category browser-idle-startup moz-src:///browser/components/search/SERPCategorization.sys.mjs SERPCategorization.init
+3 −46
Original line number Diff line number Diff line
@@ -402,42 +402,7 @@ let JSWINDOWACTORS = {
    allFrames: true,
  },

  GenAI: {
    parent: {
      esModuleURI: "resource:///actors/GenAIParent.sys.mjs",
    },
    child: {
      esModuleURI: "resource:///actors/GenAIChild.sys.mjs",
      events: {
        mousedown: {},
        mouseup: {},
      },
    },
    allFrames: true,
    onAddActor(register, unregister) {
      let isRegistered = false;

      // Register the actor if we have a provider or support provider-less
      const maybeRegister = () => {
        if (
          Services.prefs.getCharPref("browser.ml.chat.provider", "") ||
          Services.prefs.getBoolPref("browser.ml.chat.page")
        ) {
          if (!isRegistered) {
            register();
            isRegistered = true;
          }
        } else if (isRegistered) {
          unregister();
          isRegistered = false;
        }
      };

      Services.prefs.addObserver("browser.ml.chat.page", maybeRegister);
      Services.prefs.addObserver("browser.ml.chat.provider", maybeRegister);
      maybeRegister();
    },
  },
  // GenAIParent.sys.mjs and GenAIChild.sys.mjs are missing. tor-browser#44045.

  LightweightTheme: {
    child: {
@@ -488,16 +453,8 @@ let JSWINDOWACTORS = {
    messageManagerGroups: ["browsers"],
  },

  LinkPreview: {
    parent: {
      esModuleURI: "resource:///actors/LinkPreviewParent.sys.mjs",
    },
    child: {
      esModuleURI: "resource:///actors/LinkPreviewChild.sys.mjs",
    },
    includeChrome: true,
    enablePreference: "browser.ml.linkPreview.enabled",
  },
  // LinkPreviewParent.sys.mjs and LinkPreviewChild.sys.mjs are missing.
  // tor-browser#44045.

  PageInfo: {
    child: {
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ DIRS += [
    "enterprisepolicies",
    "extensions",
    "firefoxview",
    "genai",
    # Exclude "genai" component. tor-browser#44045.
    "ipprotection",
    "messagepreview",
    "migration",
Loading