mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Enable the mozilla/use-includes-instead-of-indexOf
ESLint rule globally
This rule is available from https://www.npmjs.com/package/eslint-plugin-mozilla, and is enforced in mozilla-central. Note that we have the necessary `Array`/`String` polyfills and that most cases have already been fixed, see PRs 9032 and 9434.
This commit is contained in:
parent
2eb29409bc
commit
1cf116ab88
14 changed files with 21 additions and 17 deletions
|
@ -1208,7 +1208,7 @@ let PDFViewerApplication = {
|
|||
];
|
||||
if (info.Producer) {
|
||||
KNOWN_GENERATORS.some(function (generator, s, i) {
|
||||
if (generator.indexOf(s) < 0) {
|
||||
if (!generator.includes(s)) {
|
||||
return false;
|
||||
}
|
||||
generatorId = i + 1;
|
||||
|
@ -1490,7 +1490,7 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
|
|||
}
|
||||
try {
|
||||
let viewerOrigin = new URL(window.location.href).origin || 'null';
|
||||
if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) {
|
||||
if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) {
|
||||
// Hosted or local viewer, allow for any file locations
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue