A sugar to handle your browser.
$ npm install browser-js (--save)
var browser = require('browser-js')
browser.visit('https://github.com/kud/browser-js')
window.Browser.visit('https://github.com/kud/browser-js')
Redirect to the url given. If top as true, it'll redirect the top window.
Browser.visit('http://example.com', true)
Reload the page. If forced is true, so it will reload without using caches.
Browser.reload()
Go to the previous page.
Browser.goBack()
Open a new window.
Browser.newWindow('http://example.com')
Alias of newWindow()
.
Open a new popup.
Browser.newPopup({ url: 'http://example.com', options: { height: '758', width: '1024' } })
Returns the parent url. undefined
if not in an iframe.
Browser.getParentUrl()
Returns the parent hostname. undefined
if not in an iframe.
Browser.getParentHostname()
Redirect the main window to the url of the iframe.
Browser.redirectToOriginal()
Avoid the website as iframe.
Browser.preventEmbedded()
Check if your website is embedded (iframe) or not.
Browser.isEmbedded()
Check if your website is in a popup or not.
Browser.isPoppedUp()
-
26/03/2015 — 1.10.0
- Add
newPopup()
. Also add some tests.
- Add
-
02/02/2015 — 1.9.0
- Add
getParentUrl()
,getParentHostname()
.
- Add
-
01/02/2015 — 1.8.0
- Add
goBack()
to go to the previous page.
- Add
-
30/01/2015 — 1.7.0
- Add
newWindow()
,newTab()
is now its alias.
- Add
-
16/01/2015 — 1.6.0
- Add
reload()
to reload the page.
- Add
-
13/01/2015 — 1.5.0
- Add
isPoppedUp()
to check if your website is in a popup or not.
- Add
-
09/01/2015 — 1.4.0
- Now only CommonJS is supported.
-
09/01/2015 — 1.3.0
- Replace
parentVisit()
byvisit( url, true )
- Replace
redirectParent()
byredirectToOriginal()
- Add
newTab()
to open a new tab. Thank you captain obvious.
- Replace
-
06/01/2015 — 1.2.0
- Add
parentVisit()
- Add