diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c17a252..d345c8f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,7 @@ Currently only the Android client supports multi-device pairing. ## Standalone Registration **NOTE:** This is only for developers and will not be presented to users. -* Open the registration page: chrome-extension://fpnlppjheenfplekcodjceiknbfnengc/register.html +* Open the background page and run the following command in the console: `extension.install("standalone")`. * Enter a real phone number (Google Voice numbers work too) and country combination and choose to send an SMS. You will receive a real SMS. * Enter the verification code you received by SMS. diff --git a/js/chromium.js b/js/chromium.js index 285986b0..9f5ba48e 100644 --- a/js/chromium.js +++ b/js/chromium.js @@ -166,10 +166,16 @@ }, }; - extension.install = function() { + extension.install = function(mode) { + var id = 'installer'; + var url = 'options.html'; + if (mode === 'standalone') { + id = 'standalone-installer'; + url = 'register.html'; + } extension.windows.open({ - id: 'installer', - url: 'options.html', + id: id, + url: url, innerBounds: { width: 800, height: 666 } }); }; diff --git a/js/options.js b/js/options.js index 7be1ac61..e8c01bd9 100644 --- a/js/options.js +++ b/js/options.js @@ -80,10 +80,8 @@ var accountManager = new bg.textsecure.AccountManager(); accountManager.registerSecondDevice(setProvisioningUrl, confirmNumber, incrementCounter).then(function() { - extension.windows.getCurrent(function(appWindow) { - bg.openInbox(); - extension.windows.remove(appWindow.id); - }); + bg.openInbox(); + window.close(); }); } }); diff --git a/js/register.js b/js/register.js index ce710580..89f489f1 100644 --- a/js/register.js +++ b/js/register.js @@ -85,10 +85,9 @@ var number = phoneView.validateNumber(); var verificationCode = $('#code').val().replace(/\D+/g, ""); - localStorage.clear(); - localStorage.setItem('first_install_ran', 1); + bg.storage.put('first_install_ran', 1); accountManager.registerSingleDevice(number, verificationCode).then(function() { - extension.navigator.tabs.create("options.html"); + bg.openInbox(); window.close(); }).catch(function(e) { log(e);