diff --git a/example/index.html b/example/index.html index 3f50bea7a0de7c89f24147596eafbcbd6e074878..e94edecb80a53ce5d6de11d95e715683cd197158 100644 --- a/example/index.html +++ b/example/index.html @@ -124,7 +124,7 @@ navigator.id.get(function(assertion) { $("#oAssertion").text(assertion); checkAssertion(assertion); }; - }, {persistent: true}); + }, {allowPersistent: true}); }); $("#logout").click(function(event) { diff --git a/resources/static/dialog/controllers/dialog_controller.js b/resources/static/dialog/controllers/dialog_controller.js index d84c20a488d83b6db9a47e3da32b10f984da4dd7..daf337755e4afc1d0477dc1198bcc81141517ab3 100644 --- a/resources/static/dialog/controllers/dialog_controller.js +++ b/resources/static/dialog/controllers/dialog_controller.js @@ -94,7 +94,7 @@ getVerifiedEmail: function(origin_url, onsuccess, onerror) { return this.get(origin_url, {}, onsuccess, onerror); }, - + get: function(origin_url, params, onsuccess, onerror) { var self=this; self.onsuccess = onsuccess; @@ -103,8 +103,8 @@ if (typeof(params) == 'undefined') { params = {}; } - - self.allowPersistent = !!params.persistent; + + self.allowPersistent = !!params.allowPersistent; self.requiredEmail = params.requiredEmail; if ('onLine' in navigator && !navigator.onLine) { diff --git a/resources/static/dialog/css/popup.css b/resources/static/dialog/css/popup.css index 73c52f72bdd2564708f1f8d99fd31637693e924a..6864aef2255c262021d89188b23670e267bb8597 100644 --- a/resources/static/dialog/css/popup.css +++ b/resources/static/dialog/css/popup.css @@ -244,6 +244,12 @@ section > .contents { text-overflow: ellipsis; } +div#required_email { + padding-top: .7em; + font-size: 1.2em; + font-weight: bold; +} + #signIn .vertical { padding: 0 20px; } diff --git a/resources/static/dialog/resources/channel.js b/resources/static/dialog/resources/channel.js index 455cd6dd0018ff29bec16877df218794be53fe3b..d98f44680cc76dcbf8887d0579b779ba7909256d 100644 --- a/resources/static/dialog/resources/channel.js +++ b/resources/static/dialog/resources/channel.js @@ -54,10 +54,15 @@ (function() { var win = window, nav = navigator, - onCompleteCallback; + onCompleteCallback, + WINDOW_NAME_REGEXP= "^_mozid_signin_(.*)"; function getRelayName() { - return win.localStorage.RELAYFRAME_NAME; + var result = win.name.match(WINDOW_NAME_REGEXP); + if (result) + return result[1]; + else + return null; } function getRelayWindow() { diff --git a/resources/static/dialog/views/requiredemail.ejs b/resources/static/dialog/views/requiredemail.ejs index 20c55295941d6c9f268d36526e53eef57dccd0fe..da1a1fc86aa194a1895d90e702eeac485d84d81e 100644 --- a/resources/static/dialog/views/requiredemail.ejs +++ b/resources/static/dialog/views/requiredemail.ejs @@ -3,9 +3,7 @@ <ul class="inputs"> The site requested you sign in with - <p> - <span id="required_email"><%= email %></span> - </p> + <div id="required_email"><%= email %></div> <% if (showPassword) { %> <li id="password_section"> diff --git a/resources/static/include.js b/resources/static/include.js index c64c128c037eab4339ebc935164a0a62c39124aa..7e98a8ee8fe4e36c49a20cee52ebee25bb13c1c6 100644 --- a/resources/static/include.js +++ b/resources/static/include.js @@ -668,16 +668,20 @@ return iframe; } - function _open_window(url) { + function _open_window(url, name_suffix) { url = url || "about:blank"; // we open the window initially blank, and only after our relay frame has // been constructed do we update the location. This is done because we // must launch the window inside a click handler, but we should wait to // start loading it until our relay iframe is instantiated and ready. // see issue #287 & #286 + var window_name = "_mozid_signin"; + if (name_suffix) + window_name += "_" + name_suffix; + var dialog = window.open( url, - "_mozid_signin", + window_name, isFennec ? undefined : "menubar=0,location=0,resizable=0,scrollbars=0,status=0,dialog=1,width=700,height=375"); dialog.focus(); @@ -773,7 +777,7 @@ }); // open the window now that all else is ready - w = _open_window(ipServer + "/sign_in"); + w = _open_window(ipServer + "/sign_in", relay_iframe.getAttribute('name')); // if the RP window closes, close the dialog as well. _attach_event(window, 'unload', cleanup); diff --git a/resources/static/relay/relay.js b/resources/static/relay/relay.js index 28b6441e74171c55959af7f58a7636a3d9a9b4cd..2c434508d6f866eb6c97929c892d3b5dcadaccf1 100644 --- a/resources/static/relay/relay.js +++ b/resources/static/relay/relay.js @@ -39,8 +39,6 @@ (function() { "use strict"; - window.localStorage.RELAYFRAME_NAME = window.name; - window.console = window.console || { log: function() {} }; diff --git a/resources/static/test/qunit/resources/channel_unit_test.js b/resources/static/test/qunit/resources/channel_unit_test.js index 58f63786ea068ba6a76b404ea0b2ed8a9622212e..321ed02b26a6295bf2ba07d1e4610c0a964a0379 100644 --- a/resources/static/test/qunit/resources/channel_unit_test.js +++ b/resources/static/test/qunit/resources/channel_unit_test.js @@ -43,12 +43,10 @@ steal.then("/dialog/resources/channel", function() { // Mock in the window object as well as the frame relay var winMock = { + name : "_mozid_signin_browserid_relay_1234", location: { href: "browserid.org/sign_in" }, - localStorage: { - RELAYFRAME_NAME : "browserid_relay_1234" - }, opener: { frames: { browserid_relay_1234: {