Make sure referrer is sent to the protocol handler.

This commit is contained in:
Cheng Zhao 2013-08-27 11:37:06 +08:00
parent 15ba32b489
commit 799d9ada7d
2 changed files with 3 additions and 1 deletions

View file

@ -12,8 +12,9 @@ describe 'protocol API', ->
protocol.unregisterProtocol 'test1'
it 'calls the callback when scheme is visited', (done) ->
protocol.registerProtocol 'test2', (url) ->
protocol.registerProtocol 'test2', (url, referrer) ->
assert.equal url, 'test2://test2'
assert.equal referrer, window.location.toString()
protocol.unregisterProtocol 'test2'
done()
$.get 'test2://test2', ->

View file

@ -1,5 +1,6 @@
<html>
<head>
<meta name="referrer" content="always">
<link href="../node_modules/mocha/mocha.css" rel="stylesheet">
<script src="jquery-2.0.3.min.js"></script>
</head>