The #page-previews extension currently manages a JS global `wgPopupsFlags` [1] that mainly holds data about settings related to the #reference_previews feature. The code now moved to the #Cite extension and so most of these settings should be set there.
**Implementation plan:**
[] Add gadget detection [2] for `ReferenceTooltips` and `NavigationPopups` to Cite's codebase and disable the preview in these cases. ( Use the existing `wgPopupsConflictingRefTooltipsGadgetName` and `wgPopupsConflictingNavPopupsGadgetName` settings )
[] Move the code for detecting the user setting `wgPopupsReferencePreviews` to the Cite codebase. [3]
[] Cleanup the settings and flag code in the Popups extension. Note, that the detection for `NavigationPopups` is still relevant for popups
[] Rename the `wgPopupsConflictingRefTooltipsGadgetName` config setting and move it to Cite [4]. It's only relevant for #reference_previews .
**Note: **
- We can use the `onMakeGlobalVariablesScript` hook to set JS vars where we need the user object like done in the Popups extension.
[1] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/includes/PopupsHooks.php#246
[2] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/includes/PopupsGadgetsIntegration.php
[3] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/includes/PopupsContext.php#152
[4] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/extension.json#74