This repository has been archived by the owner on Apr 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1725 from mozilla/issue-1723-oauth-completion-imp…
…rovements feat(client): Smooth out the verification flow.
- Loading branch information
Showing
25 changed files
with
1,624 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
/** | ||
* This is a special channel that communicates between two | ||
* tabs of the same browser. It uses localStorage to communicate. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
define([ | ||
'crosstab' | ||
], function (crosstab) { | ||
|
||
function InterTabChannel(options) { | ||
options = options || {}; | ||
this._crosstab = options.crosstab || crosstab; | ||
} | ||
|
||
InterTabChannel.prototype = { | ||
emit: function (name, data) { | ||
// Sensitive data is sent across the channel and should only | ||
// be in localStorage if absolutely necessary. Only send | ||
// data if another tab is listening. | ||
if (this._crosstab.util.tabCount() > 1) { | ||
try { | ||
this._crosstab.broadcast(name, data, null); | ||
} catch (e) { | ||
// this can blow up if the browser does not support localStorage | ||
// or if on a mobile device. Ignore the error. | ||
} | ||
} | ||
}, | ||
|
||
on: function (name, callback) { | ||
this._crosstab.util.events.on(name, callback); | ||
}, | ||
|
||
off: function (name, callback) { | ||
this._crosstab.util.events.off(name, callback); | ||
}, | ||
|
||
clearMessages: function () { | ||
this._crosstab.util.clearMessages(); | ||
} | ||
}; | ||
|
||
return InterTabChannel; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.