mediawiki-extensions-Popups/src/gateway
Thiemo Kreuz 515775685c Fix a series of issues with misdetected reference elements
This installs a series of safety nets:

* The selector [href*="#"] skips links without a fragment.

* It's still possible that a fragment exists, but is empty.
mwTitle.getFragment() checks this.

* The gateway does not assume the element exists, but checks this first.
If there is no such element, the gateway aborts the request in a way
that no error popup is shown. This is currently only possible with the
`{ textStatus: 'abort', xhr: { readyState: 0 } }` response as seen in
this patch. We might need to introduce a new, more clean way to silently
quit a fetchPreviewForTitle() call.

* The test for the reference gateway finally covers the scraping code.

Bug: T214970
Bug: T214971
Change-Id: I9ec57e0fbb0d21beaaa7b359c1c2bef64d2c14f5
2019-01-31 10:29:46 +01:00
..
index.js Rename getPageSummary to fetchPreviewForTitle 2019-01-23 17:50:19 +01:00
mediawiki.js Rename getPageSummary to fetchPreviewForTitle 2019-01-23 17:50:19 +01:00
reference.js Fix a series of issues with misdetected reference elements 2019-01-31 10:29:46 +01:00
rest.js Rename getPageSummary to fetchPreviewForTitle 2019-01-23 17:50:19 +01:00
restFormatters.js Hygiene: favor const 2018-03-21 10:44:24 +00:00