# Class Browser

This object has two goals:

- hide all the global state in the browser caused by the window object
- abstract away all the browser specific features and inconsistencies

- Defined in services/browser.js:25

#####
Index

### Constructors

constructor

### Properties

$$completeOutstandingRequest
$$incOutstandingRequestCount
baseElement
cachedState
lastBrowserUrl
lastCachedState
lastHistoryState
notifyWhenNoOutstandingRequests
pendingDeferIds
taskTracker
urlChangeInit
urlChangeListeners

### Methods

$$applicationDestroyed
$$checkUrlChange
baseHref
cancel
defer
onUrlChange
state
url

##
Constructors

### constructor

- new Browser(taskTracker): Browser

- #### Parameters

  - taskTracker: TaskTracker

  #### Returns Browser

  - Defined in services/browser.js:29

##
Properties

### $$completeOutstandingRequest

$$completeOutstandingRequest: any

- Defined in services/browser.js:51

### $$incOutstandingRequestCount

$$incOutstandingRequestCount: any

- Defined in services/browser.js:53

### baseElement

baseElement: JQLite

- Defined in services/browser.js:46

### cachedState

cachedState: any

- Defined in services/browser.js:40
- Defined in services/browser.js:113
- Defined in services/browser.js:114
- Defined in services/browser.js:117

### lastBrowserUrl

lastBrowserUrl: string

- Defined in services/browser.js:44
- Defined in services/browser.js:78
- Defined in services/browser.js:140

### lastCachedState

lastCachedState: any

- Defined in services/browser.js:120

### lastHistoryState

lastHistoryState: any

- Defined in services/browser.js:42
- Defined in services/browser.js:79
- Defined in services/browser.js:121
- Defined in services/browser.js:141

### notifyWhenNoOutstandingRequests

notifyWhenNoOutstandingRequests: any

- Defined in services/browser.js:55

### pendingDeferIds

pendingDeferIds: {}

- Defined in services/browser.js:34

### taskTracker

taskTracker: TaskTracker

- Defined in services/browser.js:33

### urlChangeInit

urlChangeInit: boolean

- Defined in services/browser.js:37
- Defined in services/browser.js:164

### urlChangeListeners

urlChangeListeners: UrlChangeListener[]

- Defined in services/browser.js:36

##
Methods

### $$applicationDestroyed

- $$applicationDestroyed(): void

- #### Returns void

  - Defined in services/browser.js:171

### $$checkUrlChange

- $$checkUrlChange(): void

- #### Returns void

  - Defined in services/browser.js:182

### baseHref

- baseHref(): string

- Returns the base href of the document.

  #### Returns string

  The base href.

  - Defined in services/browser.js:195

### cancel

- cancel(deferId): boolean

- Cancels a deferred function.

  #### Parameters

  - deferId: number

    The ID of the deferred function to cancel.

  #### Returns boolean

  True if the function was successfully canceled, false otherwise.

  - Defined in services/browser.js:227

### defer

- defer(fn, delay?, taskType?): number

- Defers a function to be executed after a delay.

  #### Parameters

  - fn: (() => any)

    The function to defer.

    - - (): any

      - #### Returns any

  - `Optional` delay: number = 0

    The delay in milliseconds before executing the function.

  - `Optional` taskType: string = ...

    The type of task to track.

  #### Returns number

  The timeout ID associated with the deferred function.

  - Defined in services/browser.js:208

### onUrlChange

- onUrlChange(callback): UrlChangeListener

- Registers a callback to be called when the URL changes.

  #### Parameters

  - callback: UrlChangeListener

    The callback function to register.

  #### Returns UrlChangeListener

  The registered callback function.

  - Defined in services/browser.js:153

### state

- state(): any

- Returns the cached state.

  #### Returns any

  The cached state.

  - Defined in services/browser.js:94

### url

- url(url, state): string | Browser

- #### Parameters

  - url: any
  - state: any

  #### Returns string | Browser

  - Defined in services/browser.js:65