]> khamidou — GitHub mirrors - electron.git/commitdiff
Make sure referrer is sent to the protocol handler.
authorCheng Zhao <zcbenz@gmail.com>
Tue, 27 Aug 2013 03:37:06 +0000 (11:37 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 27 Aug 2013 03:37:06 +0000 (11:37 +0800)
spec/api/protocol.coffee
spec/index.html

index 7879d29b01644ed05e9aae517bfdb403337ca122..0a947aba62e934afbb10029cf716885efa02d177 100644 (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', ->
index c92cb81f58b7f69d1327206c386f642f7425b3d5..fd49cdfbe509283db78c4d9577952a487ee112eb 100644 (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>