Documentation ¶
Index ¶
- func CookieEnabled() bool
- func Language() string
- func OnLine() bool
- func UserAgent() string
- type HISTORY_SCROLL_RESTORATION
- type History
- func (_this *History) Back()
- func (_this *History) Count() int
- func (_this *History) Forward()
- func (_this *History) Go(delta int)
- func (_this *History) PushState(data interface{}, url *url.URL)
- func (_this *History) ReplaceState(data interface{}, url *url.URL)
- func (_this *History) ScrollRestoration() HISTORY_SCROLL_RESTORATION
- func (_this *History) SetScrollRestoration(value HISTORY_SCROLL_RESTORATION)
- func (_this *History) State() js.JSValue
- type Storage
- func (_store *Storage) At(_idx int) string
- func (_store *Storage) Clear()
- func (_store *Storage) Count() int
- func (_store *Storage) Get(key string) (_value string)
- func (_store *Storage) GetBool(key string) (_value bool)
- func (_store *Storage) GetInt(key string) (_value int)
- func (_store *Storage) Remove(key string)
- func (_store *Storage) Set(key string, value string) error
- type Window
- func (_win Window) AddBeforeUnloadEvent(_listener func(*event.BeforeUnloadEvent, *Window))
- func (_win Window) AddGenericEvent(evttype event.GENERIC_EVENT, _listener func(*event.Event, *Window))
- func (_win Window) AddHashChangeEvent(_listener func(*event.HashChangeEvent, *Window))
- func (_win Window) AddPageTransitionEvent(evttype event.PAGETRANSITION_EVENT, ...)
- func (_win Window) AddResizeEvent(_listener func(*event.UIEvent, *Window))
- func (_win Window) Alert(message string)
- func (_win Window) Blur()
- func (_win Window) Close()
- func (_win Window) Closed() bool
- func (_win Window) DevicePixelRatio() float64
- func (_win Window) Display(url url.URL)
- func (_win Window) Focus()
- func (_win Window) InnerSize() (_width int, _height int)
- func (_win Window) Navigate(url url.URL)
- func (_win Window) Open(url *url.URL, target string) Window
- func (_win Window) OuterSize() (_width int, _height int)
- func (_win Window) Print()
- func (_win Window) Reload()
- func (_win *Window) RemoveListeners()
- func (_win Window) ScrollPos() (_x float64, _y float64)
- func (_win Window) Stop()
- func (_win Window) URL() *url.URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CookieEnabled ¶
func CookieEnabled() bool
CookieEnabled eturns a Boolean value that indicates whether cookies are enabled or not.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/cookieEnabled
func Language ¶
func Language() string
Language returns a string representing the preferred language of the user, usually the language of the browser UI.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
func OnLine ¶
func OnLine() bool
OnLine Returns the online status of the browser.
The property returns a boolean value, with true meaning online and false meaning offline. The property sends updates whenever the browser's ability to connect to the network changes. The update occurs when the user follows links or when a script requests a remote page. * For example, the property should return false when users click links soon after they lose internet connection.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine
func UserAgent ¶
func UserAgent() string
UserAgent returns the user agent string for the current browser.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
Types ¶
type HISTORY_SCROLL_RESTORATION ¶
type HISTORY_SCROLL_RESTORATION string
const ( HISTORY_SR_AUTO HISTORY_SCROLL_RESTORATION = "auto" HISTORY_SR_MANUAL HISTORY_SCROLL_RESTORATION = "manual" )
type History ¶
The DOM Window object provides access to the browser's session history (not to be confused for WebExtensions history) through the history object. It exposes useful methods and properties that let you navigate back and forth through the user's history, and manipulate the contents of the history stack.
https://developer.mozilla.org/en-US/docs/Web/API/History
func SessionHistory ¶
func SessionHistory() *History
History returning attribute 'history' with type htmlmisc.History (idl: History).
https://developer.mozilla.org/en-US/docs/Web/API/Window/history
func (*History) Back ¶
func (_this *History) Back()
causes the browser to move back one page in the session history.
https://developer.mozilla.org/en-US/docs/Web/API/History/back
func (*History) Count ¶
Length eturns an integer representing the number of elements in the session history, including the currently loaded page.
https://developer.mozilla.org/en-US/docs/Web/API/History/length
func (*History) Forward ¶
func (_this *History) Forward()
causes the browser to move forward one page in the session history. It has the same effect as calling history.go(1).
https://developer.mozilla.org/en-US/docs/Web/API/History/forward
func (*History) Go ¶
Go Loads a specific page from the session history. You can use it to move forwards and backwards through the history depending on the value of a parameter.
This method is asynchronous. Add a listener for the popstate event in order to determine when the navigation has completed.
func (*History) PushState ¶
PushState adds an entry to the browser's session history stack.
https://developer.mozilla.org/en-US/docs/Web/API/History/pushState
func (*History) ReplaceState ¶
modifies the current history entry, replacing it with the state object and URL passed in the method parameters. This method is particularly useful when you want to update the state object or URL of the current history entry in response to some user action.
https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
func (*History) ScrollRestoration ¶
func (_this *History) ScrollRestoration() HISTORY_SCROLL_RESTORATION
ScrollRestoration allows web applications to explicitly set default scroll restoration behavior on history navigation.
https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration
func (*History) SetScrollRestoration ¶
func (_this *History) SetScrollRestoration(value HISTORY_SCROLL_RESTORATION)
ScrollRestoration allows web applications to explicitly set default scroll restoration behavior on history navigation.
https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration
func (*History) State ¶
State returns a value representing the state at the top of the history stack. This is a way to look at the state without having to wait for a popstate event.
The value is null until the pushState() or replaceState() method is used.
TODO: browser - handle History.State returned value
https://developer.mozilla.org/en-US/docs/Web/API/History/state
type Storage ¶
https://developer.mozilla.org/fr/docs/Web/API/Web_Storage_API
func LocalStorage ¶
func LocalStorage() *Storage
allows you to access a Storage object for the Document's origin; the stored data is saved across browser sessions.
returns nil if access is denied to the localstorage
https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
func SessionStorage ¶
func SessionStorage() *Storage
accesses a session Storage object for the current origin.
sessionStorage is similar to localStorage; the difference is that while data in localStorage doesn't expire, data in sessionStorage is cleared when the page session ends.
https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
func (*Storage) At ¶
returns the name of the nth key in a given Storage object. The order of keys is user-agent defined, so you should not rely on it.
https://developer.mozilla.org/en-US/docs/Web/API/Storage/key
func (*Storage) Clear ¶
func (_store *Storage) Clear()
clears all keys stored in a given Storage object.
https://developer.mozilla.org/en-US/docs/Web/API/Storage/clear
func (*Storage) Count ¶
Length returns the number of data items stored in a given Storage object.
returns -1 if the storage object is nil
https://developer.mozilla.org/en-US/docs/Web/API/Storage/length
func (*Storage) Get ¶
when passed a key name, will return that key's value, or null if the key does not exist, in the given Storage object.
https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem
func (*Storage) Remove ¶
when passed a key name, will remove that key from the given Storage object if it exists. The Storage interface of the Web Storage API provides access to a particular domain's session or local storage.
https://developer.mozilla.org/en-US/docs/Web/API/Storage/removeItem
func (*Storage) Set ¶
when passed a key name, will return that key's value, or null if the key does not exist, in the given Storage object.
https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem TODO: browser - handle Storage error
type Window ¶
Window
https://developer.mozilla.org/en-US/docs/Web/API/Window
func CastWindow ¶
func CastWindow(_jsv js.JSValueProvider) Window
CastWindow is casting a js.JSValue into Window.
func (Window) AddBeforeUnloadEvent ¶
func (_win Window) AddBeforeUnloadEvent(_listener func(*event.BeforeUnloadEvent, *Window))
func (Window) AddGenericEvent ¶
func (Window) AddHashChangeEvent ¶
func (_win Window) AddHashChangeEvent(_listener func(*event.HashChangeEvent, *Window))
AddHashChange is adding doing AddEventListener for 'HashChange' on target. This method is returning allocated javascript function that need to be released.
func (Window) AddPageTransitionEvent ¶
func (_win Window) AddPageTransitionEvent(evttype event.PAGETRANSITION_EVENT, _listener func(*event.PageTransitionEvent, *Window))
func (Window) AddResizeEvent ¶
func (Window) Alert ¶
instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
https://developer.mozilla.org/en-US/docs/Web/API/Window/alert
func (Window) Blur ¶
func (_win Window) Blur()
Shifts focus away from the window.
https://developer.mozilla.org/en-US/docs/Web/API/Window/blur_event
func (Window) Close ¶
func (_win Window) Close()
method closes the current window, or the window on which it was called.
https://developer.mozilla.org/en-US/docs/Web/API/Window/close
func (Window) Closed ¶
Closed ndicates whether the referenced window is closed or not.
https://developer.mozilla.org/en-US/docs/Web/API/Window/closed
func (Window) DevicePixelRatio ¶
DevicePixelRatio returns the ratio of the resolution in physical pixels to the resolution in CSS pixels for the current display device. https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
func (Window) Display ¶
Load and Display the provided URL.
The difference from the Navigate() method is that the current page will not be saved in session History, meaning the user won't be able to use the back button to navigate to it.
https://developer.mozilla.org/en-US/docs/Web/API/Location/replace
func (Window) Focus ¶
func (_win Window) Focus()
Makes a request to bring the window to the front. It may fail due to user settings and the window isn't guaranteed to be frontmost before this method returns.
https://developer.mozilla.org/en-US/docs/Web/API/Window/focus
func (Window) InnerSize ¶
InnerWidth returns the interior width of the window in pixels. This includes the width of the vertical scroll bar, if one is present.
https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth
func (Window) Navigate ¶
Navigate to the provided URL. (aka. js Assign)
After the navigation occurs, the user can navigate back by pressing the "back" button.
https://developer.mozilla.org/en-US/docs/Web/API/Location/assign
func (Window) Open ¶
Loads a specified resource into a new or existing browsing context (that is, a tab, a window, or an iframe) under a specified name.
The special target keywords, _self, _blank, _parent, and _top, can also be used.
https://developer.mozilla.org/en-US/docs/Web/API/Window/open
func (Window) Print ¶
func (_win Window) Print()
Opens the print dialog to print the current document.
https://developer.mozilla.org/en-US/docs/Web/API/Window/print
func (Window) Reload ¶
func (_win Window) Reload()
Reloads the current URL, like the Refresh button.
func (*Window) RemoveListeners ¶
func (_win *Window) RemoveListeners()
Release need to be called only when avent handlers have been added to the Event-target. Release removes all event listeners and release ressources allocated fot the associated js func
func (Window) ScrollPos ¶
ScrollX returns the number of pixels that the document is currently scrolled horizontally. This value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole number. You can get the number of pixels the document is scrolled vertically from the scrollY property.
https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX
func (Window) Stop ¶
func (_win Window) Stop()
stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
https://developer.mozilla.org/en-US/docs/Web/API/Window/stop