diff --git a/resources/static/dialog/resources/channel.js b/resources/static/dialog/resources/channel.js
index 5e51e0e21ef80a63d1090851193e4bcf613ed194..d3fc6b59b2557de096442d67140f6d4a28511874 100644
--- a/resources/static/dialog/resources/channel.js
+++ b/resources/static/dialog/resources/channel.js
@@ -55,19 +55,21 @@
   var win = window,
       nav = navigator,
       onCompleteCallback,
-      WINDOW_NAME_REGEXP= "^_mozid_signin_(.*)";
+      _relayWindow = null;
 
   function getRelayName() {
-    var result = win.name.match(WINDOW_NAME_REGEXP);
-    if (result)
-      return result[1];
+    var name = win.location.hash.substring(1);
+    win.location.hash = "";
+    if (name.length > 1)
+      return name;
     else
       return null;
   }
 
   function getRelayWindow() {
-    var frameWindow = win.opener.frames[getRelayName()];
-    return frameWindow;
+    if (!_relayWindow)
+      _relayWindow = win.opener.frames[getRelayName()];
+    return _relayWindow;
   }
 
   function setupNativeChannel(controller) {
diff --git a/resources/static/include.js b/resources/static/include.js
index 7e98a8ee8fe4e36c49a20cee52ebee25bb13c1c6..ac8b01f5a962e9bab55547eb51b6dad1b81c7184 100644
--- a/resources/static/include.js
+++ b/resources/static/include.js
@@ -651,7 +651,7 @@
   function _get_relayframe_id() {
     var randomString = '';
     var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
-    for (var i=0; i < 4; i++) {
+    for (var i=0; i < 8; i++) {
       randomString += possible.charAt(Math.floor(Math.random() * possible.length));
     }
     return randomString;
@@ -777,7 +777,7 @@
         });
 
         // open the window now that all else is ready
-        w = _open_window(ipServer + "/sign_in", relay_iframe.getAttribute('name'));
+        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);
@@ -831,7 +831,8 @@
     var setup_relay_iframe = function() {
       if (document.body) {
         var frameid = _get_relayframe_id();
-        relay_iframe = _open_relayframe("browserid_relay_" + frameid);
+        // removed browserid_relay_ prefix, cause why?
+        relay_iframe = _open_relayframe(frameid);
         relay_chan = Channel.build({
           window: relay_iframe.contentWindow,
           origin: ipServer,
diff --git a/resources/static/test/qunit/resources/channel_unit_test.js b/resources/static/test/qunit/resources/channel_unit_test.js
index 321ed02b26a6295bf2ba07d1e4610c0a964a0379..94c86024750ee65457228e4595406fda387b37af 100644
--- a/resources/static/test/qunit/resources/channel_unit_test.js
+++ b/resources/static/test/qunit/resources/channel_unit_test.js
@@ -43,13 +43,13 @@ 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"
+      href: "browserid.org/sign_in#1234",
+      hash: "#1234"
     },
     opener: {
       frames: {
-        browserid_relay_1234: {
+        "1234": {
           BrowserID: {
             Relay: {
               registerClient: function(methods) {
@@ -136,7 +136,7 @@ steal.then("/dialog/resources/channel", function() {
 
   test("IFRAME channel with error on open", function() {
     var winMockWithoutRelay = $.extend(true, {}, winMock);
-    delete winMockWithoutRelay.opener.frames.browserid_relay_1234;
+    delete winMockWithoutRelay.opener.frames['1234'];
 
     channel.init({
       window: winMockWithoutRelay,