forked from mirrors/gecko-dev
Most of the ReaderMode.jsm and Readability.js code is only needed when we actually need to render a document in reader mode, but also winds up loaded into any process where we ever check if a page is readerable. This winds up wasting a huge amount of memory (and probably a huge amount of CPU time) loading code which is almost never used. This patch splits ReaderMode.jsm into two modules, one for checking readability, one for actually entering reader mode. It also separates out the isProbablyReaderable checks from Readability.js, since the overhead of loading that script before it's needed is unsupportable. This means we're probably going to need some effort to keep Readerable.jsm and Readability.js in sync, but the code in question is pretty trivial, so it shouldn't be too difficult. Differential Revision: https://phabricator.services.mozilla.com/D3687 --HG-- rename : toolkit/components/reader/Readability.js => toolkit/components/reader/Readability-readerable.js rename : toolkit/components/reader/ReaderMode.jsm => toolkit/components/reader/Readerable.js extra : rebase_source : 66712057591ae20dd66234e3dc78fbba90a6914e extra : amend_source : f908f62f49ea54b9099ddb87d9f2fc11f12d4dee
30 lines
665 B
Python
30 lines
665 B
Python
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
# vim: set filetype=python:
|
|
# 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/.
|
|
|
|
JAR_MANIFESTS += ['jar.mn']
|
|
|
|
EXTRA_JS_MODULES += [
|
|
'AboutReader.jsm',
|
|
'ReaderMode.jsm',
|
|
]
|
|
|
|
EXTRA_PP_JS_MODULES += [
|
|
'Readerable.jsm',
|
|
]
|
|
|
|
EXTRA_JS_MODULES.reader = [
|
|
'JSDOMParser.js',
|
|
'Readability.js',
|
|
'ReaderWorker.js',
|
|
'ReaderWorker.jsm',
|
|
]
|
|
|
|
BROWSER_CHROME_MANIFESTS += [
|
|
'test/browser.ini'
|
|
]
|
|
|
|
with Files('**'):
|
|
BUG_COMPONENT = ('Toolkit', 'Reader Mode')
|