зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1893471 - Rename TranslationsParent.isRestrictedPage r=translations-reviewers,gregtatum
Renames the TranslationsParent.isRestrictedPage function to isFullPageTranslationsRestrictedForPage to be more clear about which translation functionality is restricted. Differential Revision: https://phabricator.services.mozilla.com/D208697
This commit is contained in:
Родитель
3922226d5d
Коммит
135587539d
|
@ -4840,7 +4840,7 @@ var XULBrowserWindow = {
|
|||
}
|
||||
}
|
||||
|
||||
if (TranslationsParent.isRestrictedPage(gBrowser)) {
|
||||
if (TranslationsParent.isFullPageTranslationsRestrictedForPage(gBrowser)) {
|
||||
this._menuItemForTranslations.setAttribute("disabled", "true");
|
||||
} else {
|
||||
this._menuItemForTranslations.removeAttribute("disabled");
|
||||
|
|
|
@ -637,7 +637,7 @@ export class TranslationsParent extends JSWindowActorParent {
|
|||
* @param {object} gBrowser
|
||||
* @returns {boolean}
|
||||
*/
|
||||
static isRestrictedPage(gBrowser) {
|
||||
static isFullPageTranslationsRestrictedForPage(gBrowser) {
|
||||
const contentType = gBrowser.selectedBrowser.documentContentType;
|
||||
const scheme = gBrowser.currentURI.scheme;
|
||||
|
||||
|
@ -645,7 +645,8 @@ export class TranslationsParent extends JSWindowActorParent {
|
|||
return true;
|
||||
}
|
||||
|
||||
// Keep this logic up to date with TranslationsChild.prototype.#isRestrictedPage.
|
||||
// Keep this logic up to date with the "matches" array in the
|
||||
// `toolkit/modules/ActorManagerParent.sys.mjs` definition.
|
||||
switch (scheme) {
|
||||
case "https":
|
||||
case "http":
|
||||
|
|
Загрузка…
Ссылка в новой задаче