Bug 1881094 - 9. remove most remaining firefox-android eslint exclusions r=android-reviewers,frontend-codestyle-reviewers,webcompat-reviewers,gl,Gijs,Standard8,twisniewski

Differential Revision: https://phabricator.services.mozilla.com/D214041
This commit is contained in:
Geoff Brown
2024-06-19 16:19:14 +00:00
parent 956df06616
commit f3622debc5
22 changed files with 73 additions and 31 deletions

View File

@@ -194,20 +194,9 @@ mobile/android/locales/
mobile/android/android-components/components/feature/readerview/src/main/assets/extensions/readerview/manifest.json
mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.json
# TODO - Bug 1881094: temporarily ignored for firefox-android migration
mobile/android/android-components/components/browser/errorpages/src/main/assets/errorPageScripts.js
mobile/android/android-components/components/browser/icons/src/main/assets/extensions/browser-icons/icons.js
mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/background.js
mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js
mobile/android/android-components/components/feature/readerview/src/main/assets/extensions/readerview/
mobile/android/android-components/components/feature/search/src/main/assets/extensions/ads/adsTelemetry.js
mobile/android/android-components/components/feature/search/src/main/assets/extensions/search/searchTelemetry.js
mobile/android/android-components/components/feature/webcompat/src/main/assets/extensions/webcompat/
# Bug 1903138: remaining issues from the firefox-android migration
mobile/android/android-components/docs/assets/js/icon-js.js
mobile/android/android-components/samples/browser/src/main/assets/extensions/test/background.js
mobile/android/fenix/app/src/androidTest/assets/
mobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/syncintegration/
mobile/android/fenix/app/src/main/assets/
mobile/android/focus-android/app/src/androidTest/assets/
# Pre-processed/pref files

View File

@@ -271,6 +271,7 @@ const rollouts = [
"gfx/layers/layerviewer/layerTreeView.js",
"layout/tools/reftest/reftest-analyzer.xhtml",
"mobile/android/geckoview/src/androidTest/**",
"mobile/android/android-components/components/feature/webcompat/**",
"services/automation/ServicesAutomation.sys.mjs",
"services/settings/RemoteSettings.worker.mjs",
"services/sync/modules/SyncDisconnect.sys.mjs",

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable no-unsanitized/property */ /* bug 1889942 */
/**
* Handles the parsing of the ErrorPages URI and then passes them to injectValues
*/

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/*
* This web extension looks for known icon tags, collects URLs and available
* meta data (e.g. sizes) and passes that to the app code.
@@ -25,7 +27,7 @@ function sizesToList(sizes) {
function collect_link_icons(icons, rel) {
document
.querySelectorAll('link[rel="' + rel + '"]')
.forEach(function (currentValue, currentIndex, listObj) {
.forEach(function (currentValue) {
icons.push({
type: rel,
href: currentValue.href,
@@ -38,7 +40,7 @@ function collect_link_icons(icons, rel) {
function collect_meta_property_icons(icons, property) {
document
.querySelectorAll('meta[property="' + property + '"]')
.forEach(function (currentValue, currentIndex, listObj) {
.forEach(function (currentValue) {
icons.push({
type: property,
href: currentValue.content,
@@ -49,7 +51,7 @@ function collect_meta_property_icons(icons, property) {
function collect_meta_name_icons(icons, name) {
document
.querySelectorAll('meta[name="' + name + '"]')
.forEach(function (currentValue, currentIndex, listObj) {
.forEach(function (currentValue) {
icons.push({
type: name,
href: currentValue.content,

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/*
Establish communication with native application.
*/

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/*
Establish communication with native application.
*/

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
// This background script is needed to update the current tab
// and activate reader view.
@@ -18,5 +20,6 @@ browser.runtime.onMessage.addListener(message => {
})();
default:
console.error(`Received unsupported action ${message.action}`);
return false;
}
});

View File

@@ -2,6 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/* import-globals-from readability/readability-readerable-0.4.2.js */
// This script is injected into content to determine whether or not a
// page is readerable, and to open a reader view extension page via
// the background script.
@@ -46,7 +49,7 @@ function connectNativePort() {
let port = browser.runtime.connectNative("mozacReaderview");
port.onMessage.addListener(message => {
switch (message.action) {
case "cachePage":
case "cachePage": {
let serializedDoc = new XMLSerializer().serializeToString(document);
browser.runtime.sendMessage({
action: "addSerializedDoc",
@@ -54,6 +57,7 @@ function connectNativePort() {
id: message.id,
});
break;
}
case "checkReaderState":
port.postMessage({
type: "checkReaderState",
@@ -75,11 +79,11 @@ let port = connectNativePort();
// do want to connect a new native port to trigger a new readerable check and
// apply the same logic (as on page load) in our feature class (e.g. updating the
// toolbar etc.)
window.addEventListener("pageshow", event => {
window.addEventListener("pageshow", _event => {
port = port != null ? port : connectNativePort();
});
window.addEventListener("pagehide", event => {
window.addEventListener("pagehide", _event => {
port.disconnect();
port = null;
});

View File

@@ -2,6 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/* eslint-disable no-unsanitized/property */ /* bug 1903144 */
/* import-globals-from readability/readability-0.4.2.js */
/* import-globals-from readability/JSDOMParser-0.4.2.js */
// Class names to preserve in the readerized output. We preserve these class
// names so that rules in readerview.css can match them. This list is taken from Fennec:
// https://dxr.mozilla.org/mozilla-central/rev/7d47e7fa2489550ffa83aae67715c5497048923f/toolkit/components/reader/ReaderMode.jsm#21
@@ -277,7 +282,7 @@ function fetchDocument(url) {
xhr.open("GET", url, true);
xhr.onerror = evt => reject(evt.error);
xhr.responseType = "document";
xhr.onload = evt => {
xhr.onload = _evt => {
if (xhr.status !== 200) {
reject("Reader mode XHR failed with status: " + xhr.status);
return;
@@ -299,6 +304,7 @@ function getPreparedDocument(id, url) {
.sendMessage({ action: "getSerializedDoc", id })
.then(serializedDoc => {
if (serializedDoc) {
// eslint-disable-next-line no-undef
let doc = new JSDOMParser().parse(serializedDoc, url);
resolve(doc);
} else {
@@ -321,7 +327,7 @@ function connectNativePort() {
let port = browser.runtime.connectNative("mozacReaderviewActive");
port.onMessage.addListener(message => {
switch (message.action) {
case "show":
case "show": {
async function showAsync(options) {
try {
let doc;
@@ -339,6 +345,7 @@ function connectNativePort() {
}
readerView.show(doc, articleUrl, options);
} catch (e) {
// eslint-disable-next-line no-console
console.log(e);
// We weren't able to find the prepared document and also
// failed to fetch it. Let's load the original page which
@@ -348,8 +355,10 @@ function connectNativePort() {
}
showAsync(message.value);
break;
}
case "hide":
window.location.href = articleUrl;
break;
case "setColorScheme":
readerView.setColorScheme(message.value.toLowerCase());
break;

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/**
* Send
* - current URL
@@ -74,6 +76,7 @@ const eventLogger = event => {
}
break;
default:
// eslint-disable-next-line no-console
console.log("Event:", event.type);
}
};

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/**
* Send
* - current URL
@@ -53,6 +55,7 @@ const eventLogger = event => {
}
break;
default:
// eslint-disable-next-line no-console
console.log("Event:", event.type);
}
};

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env webextensions */
/* Avoid adding ID selector rules in this style sheet, since they could
* inadvertently match elements in the article content. */

View File

@@ -37,12 +37,12 @@
mutedVideo.requestFullscreen();
}
mutedVideo.addEventListener("playing", event => {
mutedVideo.addEventListener("playing", _event => {
document.querySelector(".playbackState").innerHTML =
"Media file is playing";
});
mutedVideo.addEventListener("pause", event => {
mutedVideo.addEventListener("pause", _event => {
document.querySelector(".playbackState").innerHTML =
"Media file is paused";
});

View File

@@ -30,7 +30,7 @@
}
var textToShow = valSwap();
window.addEventListener("DOMContentLoaded", event => {
window.addEventListener("DOMContentLoaded", _event => {
document.querySelector("h1").innerHTML = textToShow;
});
</script>

View File

@@ -37,12 +37,12 @@
video.requestFullscreen();
}
video.addEventListener("playing", event => {
video.addEventListener("playing", _event => {
document.querySelector(".playbackState").innerHTML =
"Media file is playing";
});
video.addEventListener("pause", event => {
video.addEventListener("pause", _event => {
document.querySelector(".playbackState").innerHTML =
"Media file is paused";
});

View File

@@ -0,0 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
module.exports = {
globals: {
Bookmarks: false,
EnableEngines: false,
Passwords: false,
Phase: false,
Sync: false,
},
};

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable no-unsanitized/property */ /* bug 1889942 */
/**
* Handles the parsing of the ErrorPages URI and then passes them to injectValues
*/

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable no-unsanitized/property */ /* bug 1889942 */
/**
* Handles the parsing of the ErrorPages URI and then passes them to injectValues
*/

View File

@@ -73,6 +73,7 @@
</body>
<script type="text/javascript">
/* import-globals-from /mobile/android/android-components/components/browser/errorpages/src/main/assets/errorPageScripts.js */
if (window.history.length == 1) {
document.getElementById("advancedPanelBackButton").style.display = "none";
}

View File

@@ -17,7 +17,7 @@
const audio = document.querySelector("audio");
var showPlayingAlert = true;
audio.addEventListener("playing", event => {
audio.addEventListener("playing", _event => {
<!--document.querySelector('.playbackState').innerText="Media file is playing"-->
<!--Need this hack to verify that the video is playing,-->
<!--the test cannot currently verify the text displayed on the page-->
@@ -27,7 +27,7 @@
}
});
audio.addEventListener("pause", event => {
audio.addEventListener("pause", _event => {
<!--document.querySelector('.playbackState').innerText="Media file is paused"-->
alert("Media file is paused");
});

View File

@@ -33,7 +33,7 @@
var showPlayAlert = true;
mutedVideo.addEventListener("playing", event => {
mutedVideo.addEventListener("playing", _event => {
<!-- document.querySelector('.playbackState').innerHTML="Media file is playing";-->
<!-- Need this hack to verify that the video is playing, -->
<!-- the test cannot currently verify the text displayed on the page-->
@@ -43,7 +43,7 @@
}
});
mutedVideo.addEventListener("pause", event => {
mutedVideo.addEventListener("pause", _event => {
// document.querySelector('.playbackState').innerHTML="Media file is paused";
alert("Media file is paused");
});

View File

@@ -33,7 +33,7 @@
var showPlayingAlert = true;
video.addEventListener("playing", event => {
video.addEventListener("playing", _event => {
<!-- document.querySelector('.playbackState').innerHTML="Media file is playing";-->
<!-- Need this hack to verify that the video is playing, -->
<!-- the test cannot currently verify the text displayed on the page-->
@@ -43,7 +43,7 @@
}
});
video.addEventListener("pause", event => {
video.addEventListener("pause", _event => {
// document.querySelector('.playbackState').innerHTML="Media file is paused";
alert("Media file is paused");
});