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:
Jonas Jenwald 2018-02-10 17:06:03 +01:00
parent 2eb29409bc
commit 1cf116ab88
14 changed files with 21 additions and 17 deletions

View file

@ -29,7 +29,7 @@ function getViewerURL(pdf_url) {
* @return {boolean} True if the PDF file should be downloaded.
*/
function isPdfDownloadable(details) {
if (details.url.indexOf('pdfjs.action=download') >= 0) {
if (details.url.includes('pdfjs.action=download')) {
return true;
}
// Display the PDF viewer regardless of the Content-Disposition header if the
@ -39,8 +39,7 @@ function isPdfDownloadable(details) {
// viewer to open the PDF, but first check whether the Content-Disposition
// header specifies an attachment. This allows sites like Google Drive to
// operate correctly (#6106).
if (details.type === 'main_frame' &&
details.url.indexOf('=download') === -1) {
if (details.type === 'main_frame' && !details.url.includes('=download')) {
return false;
}
var cdHeader = (details.responseHeaders &&