Commit graph

5 commits

Author SHA1 Message Date
Jon Robson 8f03303dc4 Restrict page previews to browsers that support multiple not selectors
Change-Id: Ia45c03d1fd6949bf83ebed6d40075e453e42cdd7
2023-05-12 13:43:18 -07:00
Jon Robson 2517c6d32f Performance: Remove unnecessary requestIdleCallback delay
Load page previews as quickly as possible.
According to performance team it should be beneficial to remove
this (See Ibc01f6a82692c7dd3d4a866354ab975af114e7b0 for more
information) and it's not a recommendation. its existence
in this codebase is leading to misunderstandings elsewhere.

Change-Id: If183d9ca07d98c03c957f359c13ca8e2ede7ad58
2023-01-09 16:57:05 +00:00
Jon Robson 0febc3f54d Extensible previews
Allow extensions to register new types of previews via
extension attributes.

Changes:

- The check for reference previews doesn't make sense
as $('a[ href*="#" ]' ) will match any elements with a hash
fragment, so the additional check to Title.getFragment
will not provide a different result. This was introduced in
I9ec57e0fbb0d21beaaa7b359c1c2bef64d2c14f5
- Links that point to themselves are marked with mw-selflink
in MediaWiki so this can use the not selector we already have.
- The new API is used internally and only available via extension
Attributes
- An example is provided in SkinJSON
(https://github.com/jdlrobson/mediawiki-skins-skinjson/pull/14)

Bug: T233099
Change-Id: Iefe98c1f0422dbf034e385b1a41a859d030a2cf4
2022-11-22 08:45:27 -08:00
jdlrobson c597522b7d Enable Popups module in mobile, use feature detection to enable
This means that users of the mobile site on a desktop browser will
now benefit from Popups.

Targets is not necessary for `ext.popups.images` as these modules are
enabled on mobile by default.

Bug: T236097
Change-Id: I401fbb522ec97fdc81259702c8283c95386531af
2020-04-02 18:23:31 +00:00
jdlrobson deaaf0961b Remove popups from critical rendering path
Instead load it via mw.loader.using

We retain the module name ext.popups as this will be present
in cached HTML, however now it will load the bulk of the code
inside ext.popups.main

Bug: T176211
Change-Id: Ibe212721807d3698dc45ef46b2dbde15ca9d2f70
2018-03-13 08:44:31 -07:00