Commit Graph
311 Commits
Author SHA1 Message Date
Kris Maglione ba396c04a5 Bug 1484413: Split ReaderMode.jsm into separate checking and loading components. r=Gijs
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
2018-08-17 23:10:59 -07:00
Christian 5396eca64c Bug 1486315 - Replace promiseWaitForCondition with TestUtils.waitForCondition in reader mode tests. r=johannh 2018-09-05 12:19:54 -07:00
Dão Gottwald 9425c53e0b Bug 1480415 - Set aria-label on Reader View button and set menuitem-specific attributes directly there instead of on the command element. r=jaws 2018-09-05 14:49:15 +02:00
Nicholas Nethercote 357e821fd9 Bug 1488321 - Fix up nsISHEntry.{index,getEntryAtIndex()}. r=nika
nsISHEntry.index is readonly, but if you pass `true` as getEntryAtIndex()'s
second argument, nsISHEntry.index will be modified. This is pretty gross.

This patch changes `index` so it's not readonly (because it's not!) and removes
getEntryAtIndex()'s second argument.
2018-09-05 09:02:37 +10:00
Mark Banner 462116b7f9 Bug 1486739 - Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/. r=mossop
Automatic changes by ESLint, except for manual corrections for .xml files.

Differential Revision: https://phabricator.services.mozilla.com/D4439
2018-08-31 05:59:17 +00:00
Gijs Kruitbosch 7c552b8557 Bug 1487044 - sync reader mode to github tip ( 3be1aaa01c078c25b67ed8dfd1c9aa8f9963490b ), r=johannh,gijs 2018-08-29 12:51:09 +01:00
Nicholas Nethercote 0da74f7f34 Bug 1486356 - Remove nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER. r=nika
It's a no-longer-needed synonym for LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL.
2018-08-27 14:27:35 +10:00
Bianca Danforth 0a93f06dfe Bug 1457226 - Revert Savant Shield study commits; r=rhelmer
The Savant pref flip Shield study was ended on 08-20-18 (https://bugzilla.mozilla.org/show_bug.cgi?id=1457226#c28), so this patch removes all temporary study code from Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D4285
2018-08-27 18:17:43 +00:00
vinoth 2c235cb4d3 Bug 1480934 - Saving Reader View page yields blank page fixed by removing inline style r=jaws,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D2947
2018-08-14 03:26:24 +00:00
Andreea Pavel a21cdf67b1 Backed out changeset b7531c106b59 (bug 1480934) for failing android at mobile/android/tests/browser/chrome/test_session_scroll_position.html on a CLOSED TREE 2018-08-14 08:22:04 +03:00
vinoth cbd27d9368 Bug 1480934 - Saving Reader View page yields blank page fixed by removing inline style r=jaws,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D2947
2018-08-14 03:26:24 +00:00
Drew Willcoxon 6460a97414 Bug 1462790 - Update Save to Pocket icons to use outline icon treatment. r=jaws
Update the Save to Pocket svg icons in the urlbar, page action panel, and reader view. There's another Save to Pocket icon in activity stream that the bug doesn't mention but that should probably be updated too. I'll make a different revision for it.

Differential Revision: https://phabricator.services.mozilla.com/D2676
2018-08-02 20:13:13 +00:00
Mark Banner acbefc481e Bug 1478308 - Remove unnecessary ChromeUtils.imports in toolkit/ r=mikedeboer
MozReview-Commit-ID: 45Tfs2ZZ06r
2018-07-25 11:00:35 +01:00
Narcis Beleuzu c2c876bd2a Backed out 4 changesets (bug 1478308) for ESlint failure on AttributionCode.jsm. CLOSED TREE
Backed out changeset a809b45ff49b (bug 1478308)
Backed out changeset c68131530742 (bug 1478308)
Backed out changeset 0e4ba7a6dc1a (bug 1478308)
Backed out changeset 32a27f317a77 (bug 1478308)
2018-07-26 11:13:28 +03:00
Mark Banner 776b40e8be Bug 1478308 - Remove unnecessary ChromeUtils.imports in toolkit/ r=mikedeboer
MozReview-Commit-ID: 45Tfs2ZZ06r
2018-07-25 11:00:35 +01:00
Boris Zbarsky 1b419c917c Bug 1476145 part 6. Stop using getInterface(nsIDOMWindowUtils) in toolkit. r=mossop
This is not quite a mechanical change, because some places have a .top or
whatnot snuck in there, so please review carefully!
2018-07-24 19:47:42 -04:00
Gijs Kruitbosch 9f60da81a5 Bug 1472749 - fix reader mode on nytimes website (sync from github 7d03bec52d0a0c4b22d044e06af84abb15a9f02b), r=jaws 2018-07-10 14:24:43 +01:00
Coroiu Cristina 72b3df5f72 Merge mozilla-central to autoland a=merge on a CLOSED TREE 2018-06-30 01:00:54 +03:00
Dave Townsend 0f2c3bd648 Bug 1453751: Load favicons in the content process. r=mak, r=gijs, r=aswan, r=mixedpuppy
Summary:
This moves the load of favicons into the content process. We use the same logic
for finding favicons (based on waiting until none have shown up for a short
time) but then load the favicon and convert it to a data uri which we then
dispatch to the parent process. Along the way this fixes asssociating the load
with the tab for WebExtension and devtools, fixes CSP usage for the load, fixes
expiry detection of the favicon and stops us from loading the same resource
twice.

This change also merges the prefs browser.chrome.site_icons and
browser.chrome.favicons leaving just the former controlling favicon loading. It
adds the pref browser.chrome.guess_favicon to allow disabling guessing where
a favicon might be located for a site (at <hostname>/favicon.ico). This is
mainly to allow disabling this in tests where those additional yet automatic
requests are uninteresting for the test.

There are multiple clean-ups that can follow this but this is a first step along
that path.

MozReview-Commit-ID: E0Cs59UnxaF

Reviewers: mak

Tags: #secure-revision

Bug #: 1453751

Differential Revision: https://phabricator.services.mozilla.com/D1672
Differential Revision: https://phabricator.services.mozilla.com/D1673
Differential Revision: https://phabricator.services.mozilla.com/D1674
Differential Revision: https://phabricator.services.mozilla.com/D1850
Differential Revision: https://phabricator.services.mozilla.com/D1869
2018-06-28 16:06:09 -07:00
Gijs Kruitbosch 74af22f0e6 Bug 1399616 - add emoji styling to reader mode, r=johannh
MozReview-Commit-ID: DHYjxva76Lb
2018-06-20 15:09:26 +01:00
Brindusan Cristian d94fd86e60 Backed out changeset b11aa832c41a (bug 1453751) for Mochitest-15 failures in toolkit/components/extensions/test/mochitest/test_ext_webrequest_filter.html. CLOSED TREE 2018-06-28 23:15:49 +03:00
Dave Townsend ebc2c6ff75 Bug 1453751: Load favicons in the content process. r=mak, r=gijs, r=aswan
Summary:
This moves the load of favicons into the content process. We use the same logic
for finding favicons (based on waiting until none have shown up for a short
time) but then load the favicon and convert it to a data uri which we then
dispatch to the parent process. Along the way this fixes asssociating the load
with the tab for WebExtension and devtools, fixes CSP usage for the load, fixes
expiry detection of the favicon and stops us from loading the same resource
twice.

This change also merges the prefs browser.chrome.site_icons and
browser.chrome.favicons leaving just the former controlling favicon loading. It
adds the pref browser.chrome.guess_favicon to allow disabling guessing where
a favicon might be located for a site (at <hostname>/favicon.ico). This is
mainly to allow disabling this in tests where those additional yet automatic
requests are uninteresting for the test.

There are multiple clean-ups that can follow this but this is a first step along
that path.

MozReview-Commit-ID: E0Cs59UnxaF

Reviewers: mak

Tags: #secure-revision

Bug #: 1453751

Differential Revision: https://phabricator.services.mozilla.com/D1672
Differential Revision: https://phabricator.services.mozilla.com/D1673
Differential Revision: https://phabricator.services.mozilla.com/D1674
Differential Revision: https://phabricator.services.mozilla.com/D1850
2018-06-04 12:53:55 -07:00
Cosmin Sabou 42e854deed Backed out changeset 638eb8a41245 (bug 1453751) for frequent linux debug e-10s failures on test_ext_webrequest_filter.html 2018-06-26 07:29:35 +03:00
Dave Townsend e6cce6de21 Bug 1453751: Load favicons in the content process. r=mak, r=gijs, r=aswan
Summary:
This moves the load of favicons into the content process. We use the same logic
for finding favicons (based on waiting until none have shown up for a short
time) but then load the favicon and convert it to a data uri which we then
dispatch to the parent process. Along the way this fixes asssociating the load
with the tab for WebExtension and devtools, fixes CSP usage for the load, fixes
expiry detection of the favicon and stops us from loading the same resource
twice.

This change also merges the prefs browser.chrome.site_icons and
browser.chrome.favicons leaving just the former controlling favicon loading. It
adds the pref browser.chrome.guess_favicon to allow disabling guessing where
a favicon might be located for a site (at <hostname>/favicon.ico). This is
mainly to allow disabling this in tests where those additional yet automatic
requests are uninteresting for the test.

There are multiple clean-ups that can follow this but this is a first step along
that path.

MozReview-Commit-ID: E0Cs59UnxaF

Reviewers: mak

Tags: #secure-revision

Bug #: 1453751

Differential Revision: https://phabricator.services.mozilla.com/D1672
Differential Revision: https://phabricator.services.mozilla.com/D1673
Differential Revision: https://phabricator.services.mozilla.com/D1674
2018-06-04 12:53:55 -07:00
kanika b75efc14de Bug 1428847 - Move is_hidden and is_visible helper functions into BrowserTestUtils.jsm. r=johannh
MozReview-Commit-ID: 2xshA0CAPgY
2018-03-22 21:14:23 +05:30
Gijs Kruitbosch 87e53998e4 Bug 1467742 - update reader mode code and tests for readability updates, r=jaws
The phrasing content change means that the contents of <div id="foo"> were being put
in their own paragraph inside that div, and then later the singly nested <div><p></p></div>
is unnested and we throw the div away, thus losing the ID attribute, which causes the
browser_readerMode_with_anchor test to fail. The test document is a bit abstract and
I doubt this will be an issue in practice, though I filed
https://github.com/mozilla/readability/issues/460 to copy the id attribute across for
cases where the inner <p> has no such attribute (which would preserve the
id in this case).

MozReview-Commit-ID: 8XBKFiYllxY
2018-06-08 12:54:35 +01:00
Gijs Kruitbosch 381556b10d Bug 1467742 - update readability from github rev 8fec62d246f563090f5711c02907e2bea7ce96f8, r=jaws
MozReview-Commit-ID: JPdLWPyToCb
2018-06-08 11:57:03 +01:00
Kris Maglione 0847e8227e Bug 1464548: Part 3 - Update callers to use defineLazyGlobalGetters. r=mccr8
MozReview-Commit-ID: 9APGewiDDYB
2018-05-25 17:02:29 -07:00
Bianca Danforth 102fa1b496 Bug 1465698 - Add readermode event probes for Savant Shield study; r=jaws
These probes will register and record (for the duration of the study only):
* When the user turns on Reader Mode.
* When the user turns off Reader Mode.

Note: The events are recorded in the content process.

MozReview-Commit-ID: BNEYW3TP1aN
2018-06-06 03:56:32 -07:00
Gijs Kruitbosch d1016b8c8d Bug 1456652 - use triggering principal when leaving reader mode, r=mgoodwin 2018-04-26 12:30:34 +01:00
Kris Maglione b3990a2d91 Bug 1456686: Part 1 - Fix unused and shadowed explicit imports. r=standard8
These issues were previously ignored due to the nature of our global import
rules. They need to be fixed before that rule can be updated.

MozReview-Commit-ID: DCChktTc5TW
2018-04-24 20:18:09 -07:00
Francois Marier 81700f7916 Bug 1453818 - Add test for same-site cookies in reader mode. r=ckerschb,Gijs
MozReview-Commit-ID: 58j7geRM6KW
2018-04-17 13:40:18 -07:00
Cosmin Sabou 7a1f6f1227 Backed out changeset fd0857bfc9d4 (bug 1453818) for ESlint failure on browser_bug1453818_samesite_cookie.js. CLOSED TREE 2018-04-20 00:13:20 +03:00
Francois Marier 6bc37f5292 Bug 1453818 - Add test for same-site cookies in reader mode. r=ckerschb,Gijs
MozReview-Commit-ID: 58j7geRM6KW
2018-04-17 13:40:18 -07:00
Marco Bonardo ffb9670998 Bug 1453580 - Remove promiseFaviconLinkUrl and fix its consumers. r=Gijs
MozReview-Commit-ID: GrY8s3l71Mp
2018-04-16 18:24:06 +02:00
Dorel Luca af4700d8df Backed out changeset 897bbf35e781 (bug 1453580) for XPCShell failure on services/sync/tests/unit/test_syncedtabs.js. CLOSED TREE 2018-04-18 14:06:34 +03:00
Marco Bonardo 11e458b637 Bug 1453580 - Remove promiseFaviconLinkUrl and fix its consumers. r=Gijs
MozReview-Commit-ID: GrY8s3l71Mp
2018-04-16 18:24:06 +02:00
Nika Layzell 3d4a532d9d Bug 1434768 - Part 3: Rewrite JS consumers of .sessionHistory, r=bz 2018-04-10 17:49:45 -04:00
Boris Zbarsky b048abbbb9 Bug 1452235 part 3. Stop using nsIDOMSerializer from JS. r=qdot
MozReview-Commit-ID: JbWGcfbmM4b
2018-04-09 16:30:32 -04:00
Kris Maglione 9d5b9190a5 Bug 1443964: Part 3 - Remove no-cpows-in-tests rule. r=mconley
The shims that this rule tests for no longer exist.

MozReview-Commit-ID: DMgP7Hczavc
2018-03-07 19:31:28 -08:00
Kris Maglione c52d401bb4 Bug 1445551: Part 1b - Whitelist unsafe CPOW use in existing tests. r=mconley
MozReview-Commit-ID: 4ojwvjw9XGT
2018-03-14 14:35:05 -07:00
Gijs Kruitbosch 1680636bcc Bug 1444082 - sync reader mode to github tip ( 8525c6af36d3badbe27c4672a6f2dd99ddb4097f ), r=johannh
MozReview-Commit-ID: LZLFf9kyUR5
2018-03-08 14:35:02 +00:00
Mark Banner 29e56bce9b Bug 1434869 - Automatically mark EXPORTED_SYMBOLS as used, so that we don't need to ignore it in ESLint's no-unused-vars rule. r=florian.
MozReview-Commit-ID: IVMeZHGdVBk
2018-03-06 12:01:59 +00:00
Florian Quèze f1a55f73f8 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Christoph Kerschbaumer 8cd6de289c Bug 1436808: Apply Meta CSP to content privileged about: pages. r=gijs,freddyb 2018-02-09 11:42:21 +01:00
Mark Banner 4fd95a27c9 Bug 1230369 - Manually fix some remaining instances of Ci/Cc/Cu definitions and switch Components.* to using the shorthand in some places. r=florian
MozReview-Commit-ID: 9SmoR9RlvZE
2018-02-07 09:24:15 +00:00
Andrew McCreight 272cee1e65 Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG
2018-02-06 09:36:57 -08:00
Florian Quèze c5f15a4700 Bug 1339461 - script-generated patch to convert foo.indexOf(...) == -1 to foo.includes(), r=Mossop. 2018-02-01 20:45:22 +01:00
Sebastian Hengst 00dddd0122 Bug 1431533: Part 5z - Use ChromeUtils import methods at positions highlighted by eslint after merge. a=eslint-fix 2018-01-31 02:02:52 +02:00
arthur.iakab 384e070ea5 Merge mozilla-central to autoland 2018-01-31 00:41:58 +02:00