-type = require 'lang/type'
-Page = require 'dom/Page'
+type    = require 'lang/type'
+Page    = require 'dom/Page'
+privacy = require 'util/privacy'
 
 class Browser
   constructor: (@browser) ->

  # Get the current uri of browser as a string.
  #
  @::__defineGetter__ 'url', ->
    wesabe.taint @browser.currentURI?.resolve(null)

  #
  # Proxy addEventListener through so that event.add will work.

  go: (uri) ->
    uri = @joinURI uri
    logger.debug 'Loading uri=', uri
    @browser.loadURI privacy.untaint(uri), null, null

  #
  # Get the absolute uri by joining +uri+ to the current uri of +browser+.
  # +uri+ may be either relative or absolute.
  #
  joinURI: (uri) ->
    uri = privacy.untaint uri
    uri = @browser.currentURI?.resolve uri

    privacy.taint uri

  #
  # Determines whether browser is currently at +uri+,
