Members
-
details :NexusHoratio.spa.Details
-
Details
Methods
-
Symbol.dispose()
-
Description
Dispose of the instance.
Details
-
register( Klass ) → {NexusHoratio.spa.SPA}
-
Description
Add a new page to those supported by this instance.
Parameters
Name Type Description KlassNexusHoratio.spa.Page A
NexusHoratio.spa.Pageclass to instantiate.Returns
Details
-
<private> activate( pathname )
-
Description
Handle switching from the old page (if any) to the new one.
Parameters
Name Type Description pathnamestring A {URL.pathname}.
Details
-
<private> findPages( pathname ) → {Set.<Page>}
-
Description
Determine which pages can handle this portion of the URL.
Parameters
Name Type Description pathnamestring A {URL.pathname}.
Returns
Details
-
<private> startUserscriptManagerUrlMonitor()
-
Description
Start userscript manager based URL monitoring.
This explicitly listens on
window.Tampermonkey was the first(?) userscript manager to provide events about URLs changing. Hence the need for
@grant window.onurlchangein the UserScript header.Details
-
<private> urlChangeAdapter( info )
-
Description
The info that TM gives is not really an event. So we turn it into one and throw it again, this time onto
documentwhere something is listening for it.Parameters
Name Type Description infoobject Generic object from the userscript manager.
Fires
Details
-
<private> startMutationObserverUrlMonitor()
-
Description
Install a long lived MutationObserver that watches {Details.urlChangeMonitorSelector}.
Whenever it is triggered, it will check to see if the current URL has changed, and if so, send an appropriate event.
Fires
Details
-
<private> startUrlMonitor()
-
Description
Start URL monitoring.
If the userscript manager supports monitoring, that will be used.
This explicitly uses
documentfor the event.Details
-
<private> stopUrlMonitor()
-
Description
Stop URL monitoring.
Details
-
<private> onUrlChange( evt )
-
Description
Handle urlchange events that indicate a switch to a new page.
Parameters
Name Type Description evtCustomEvent Custom 'urlchange' event.
Details
Type Definitions
-
Pages
-
Properties
Name Type Description activeSet.<NexusHoratio.spa.Page> Currently active pages.
oldSet.<NexusHoratio.spa.Page> Pages being deactivated.
newSet.<NexusHoratio.spa.Page> Pages being activated.
Details
Events
-
activate
-
Details
-
activated
-
Details
-
initialize
-
Details
-
initialized
-
Details