== Background
Paraphrasing T164256#3243278:
When PP boots, it processes every link in the page's content by:
# Getting the list of whitelisted links in the page's content;
# Filtering the links by namespace (by creating an instance of `mw.Title` via `mw.Title.newFromText`); and
# Storing the associated title using `jQuery#data` for retrieval later.
The result is that we do a lot of processing for links that the user is unlikely to interact with [0]. Moreover, because the filtering is done upfront, we have to create event handlers for each filtered element, rather than one top-level event handler bound to the container.
== AC
# A top-level event handler is used to handle dwell and click events.
# The "dynamic" filtering is done on a per-interaction basis.
# We no longer store `mw.Title` objects using `jQuery#data`.
== Psuedocode
```name=src/index.js,lang=js
const CSS_BLACKLIST = [];
mw.hook( 'wikipage.content', ( $container ) => {
// "Static" filtering
$container.on( 'hover', 'a:not(' + CSS_BLACKLIST.join(',') + ')', ( event ) => {
// "Dynamic" filtering
const el = event.target,
title = getLinkTitle( el );
if ( title && canHandleTitle( title ) ) {
boundActions.linkDwell( el, title );
}
} );
} );
```
---
```name=[0],lang=mysql
select
avg(nInteractionsPerPage) as 'IPP'
from
(
select
count(*) as nInteractionsPerPage
from log.Popups_16364296
where
timestamp like '20170516%'
and event_linkInteractionToken is not null
group by event_pageToken
) as interactionsPerPage;
+--------+
| IPP |
+--------+
| 9.9246 |
+--------+
```