         @parent?.postMessage msg, origin
     })
 
-    if navigator.serviceWorker and window.location.protocol isnt 'http:'
+    useSw ?= navigator.serviceWorker and window.location.protocol isnt 'http:'
+
+    if useSw
       # only use service workers if current page has one
       @ready = navigator.serviceWorker.ready
       .catch -> null

  @param {Number} [config.timeout=3000] - request timeout (ms)
  @param {Function<Boolean>} config.isParentValidFn - restrict parent origin
  ###
  constructor: ({timeout, @handshakeTimeout, @isParentValidFn} = {}) ->
    @isParentValidFn ?= -> true
    timeout ?= null
    @handshakeTimeout ?= DEFAULT_HANDSHAKE_TIMEOUT_MS


    @clientValidation = @client.call 'ping', null, {timeout: @handshakeTimeout}
    .then (registeredMethods) =>
      console.log 'got reg', registeredMethods
      if registeredMethods is 'pong'
        @isLegacy = true
      else if @hasParent
