Bug 1871140 - Vendor Readability Library. r=cmkm

- Adds a moz.yaml to vendor the files from the Readability library on Github to `toolkit/components/reader/readability`.
- Updates includes to point to the new library location.

Differential Revision: https://phabricator.services.mozilla.com/D196998
This commit is contained in:
Fred Chasen 2024-01-11 21:47:21 +00:00
parent 0a81f31cdf
commit 466576038b
12 changed files with 46 additions and 40 deletions

View file

@ -241,11 +241,6 @@ toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_fail.json
toolkit/components/pdfjs/content/build toolkit/components/pdfjs/content/build
toolkit/components/pdfjs/content/web toolkit/components/pdfjs/content/web
# External code:
toolkit/components/reader/Readability.js
toolkit/components/reader/Readability-readerable.js
toolkit/components/reader/JSDOMParser.js
# Uses preprocessing # Uses preprocessing
toolkit/components/reader/Readerable.sys.mjs toolkit/components/reader/Readerable.sys.mjs

View file

@ -1211,11 +1211,6 @@ toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_fail.json
toolkit/components/pdfjs/content/build toolkit/components/pdfjs/content/build
toolkit/components/pdfjs/content/web toolkit/components/pdfjs/content/web
# External code:
toolkit/components/reader/Readability.js
toolkit/components/reader/Readability-readerable.js
toolkit/components/reader/JSDOMParser.js
# Uses preprocessing # Uses preprocessing
toolkit/components/reader/Readerable.sys.mjs toolkit/components/reader/Readerable.sys.mjs
@ -1432,6 +1427,7 @@ toolkit/components/jsoncpp/
toolkit/components/normandy/vendor/ toolkit/components/normandy/vendor/
toolkit/components/passwordmgr/PasswordRulesParser.sys.mjs toolkit/components/passwordmgr/PasswordRulesParser.sys.mjs
toolkit/components/protobuf/ toolkit/components/protobuf/
toolkit/components/reader/readability/
toolkit/components/translation/cld2/ toolkit/components/translation/cld2/
toolkit/components/translations/bergamot-translator/thirdparty toolkit/components/translations/bergamot-translator/thirdparty
toolkit/components/translations/bergamot-translator/bergamot-translator.js toolkit/components/translations/bergamot-translator/bergamot-translator.js

View file

@ -10,7 +10,7 @@
/* import-globals-from /toolkit/components/workerloader/require.js */ /* import-globals-from /toolkit/components/workerloader/require.js */
/* global JSDOMParser */ /* global JSDOMParser */
/* import-globals-from /toolkit/components/reader/Readability.js */ /* import-globals-from /toolkit/components/reader/readability/Readability.js */
importScripts( importScripts(
"resource://gre/modules/workers/require.js", "resource://gre/modules/workers/require.js",
"resource://gre/modules/reader/JSDOMParser.js", "resource://gre/modules/reader/JSDOMParser.js",

View file

@ -8,7 +8,7 @@
// Readerable.sys.mjs. // Readerable.sys.mjs.
/* exported Readerable */ /* exported Readerable */
/* import-globals-from Readability-readerable.js */ /* import-globals-from readability/Readability-readerable.js */
const { XPCOMUtils } = ChromeUtils.importESModule( const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs" "resource://gre/modules/XPCOMUtils.sys.mjs"

View file

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * 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/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
#include Readability-readerable.js #include readability/Readability-readerable.js
#include Readerable.js #include Readerable.js
export { Readerable }; export { Readerable };

View file

@ -16,8 +16,8 @@ EXTRA_PP_JS_MODULES += [
] ]
EXTRA_JS_MODULES.reader = [ EXTRA_JS_MODULES.reader = [
"JSDOMParser.js", "readability/JSDOMParser.js",
"Readability.js", "readability/Readability.js",
"Reader.worker.js", "Reader.worker.js",
"ReaderWorker.sys.mjs", "ReaderWorker.sys.mjs",
] ]

View file

@ -0,0 +1,26 @@
schema: 1
bugzilla:
product: Toolkit
component: Reader Mode
origin:
name: Readability
description: Readability library used for Firefox Reader View
url: https://github.com/mozilla/readability
license: Apache-2.0
release: 0.5.0 (2023-12-15T17:20:28+00:00).
revision: 0.5.0
vendoring:
url: https://github.com/mozilla/readability
source-hosting: github
tracking: tag
vendor-directory: toolkit/components/reader/readability
exclude:
- "**"
include:
- LICENSE.md
- Readability.js
- Readability-readerable.js
- JSDOMParser.js

View file

@ -1,11 +1,3 @@
/*eslint-env es6:false*/
/*
* DO NOT MODIFY THIS FILE DIRECTLY!
*
* This is a shared library that is maintained in an external repo:
* https://github.com/mozilla/readability
*/
/* This Source Code Form is subject to the terms of the Mozilla Public /* 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, * 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/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */

View file

@ -0,0 +1,13 @@
Copyright (c) 2010 Arc90 Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -1,12 +1,3 @@
/* eslint-env es6:false */
/* globals exports */
/*
* DO NOT MODIFY THIS FILE DIRECTLY!
*
* This is a shared library that is maintained in an external repo:
* https://github.com/mozilla/readability
*/
/* /*
* Copyright (c) 2010 Arc90 Inc * Copyright (c) 2010 Arc90 Inc
* *

View file

@ -1,11 +1,3 @@
/*eslint-env es6:false*/
/*
* DO NOT MODIFY THIS FILE DIRECTLY!
*
* This is a shared library that is maintained in an external repo:
* https://github.com/mozilla/readability
*/
/* /*
* Copyright (c) 2010 Arc90 Inc * Copyright (c) 2010 Arc90 Inc
* *

View file

@ -182,6 +182,7 @@ toolkit/components/jsoncpp/
toolkit/components/normandy/vendor/ toolkit/components/normandy/vendor/
toolkit/components/passwordmgr/PasswordRulesParser.sys.mjs toolkit/components/passwordmgr/PasswordRulesParser.sys.mjs
toolkit/components/protobuf/ toolkit/components/protobuf/
toolkit/components/reader/readability/
toolkit/components/translation/cld2/ toolkit/components/translation/cld2/
toolkit/components/translations/bergamot-translator/thirdparty toolkit/components/translations/bergamot-translator/thirdparty
toolkit/components/translations/bergamot-translator/bergamot-translator.js toolkit/components/translations/bergamot-translator/bergamot-translator.js