-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
fdbe168
commit 2ff934c
Showing
7 changed files
with
78 additions
and
24 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* 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/. */ | ||
|
||
|
||
(function() { | ||
'use strict'; | ||
|
||
// Exclude signed in users | ||
function fxaSignedOut() { | ||
Mozilla.Client.getFxaDetails(function(details) { | ||
if (!details.setup) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
}); | ||
} | ||
|
||
// courtesy of https://davidwalsh.name/query-string-javascript | ||
function getUrlParam(name) { | ||
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); | ||
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); | ||
var results = regex.exec(location.search); | ||
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); | ||
} | ||
|
||
// if we already have a `v` parameter on the page, or the user is signed into Sync, don't enter into the experiment. | ||
if (!getUrlParam('v') && fxaSignedOut) { | ||
var deckard = new Mozilla.TrafficCop({ | ||
id: 'experiment_firefox_whatsnew_68', | ||
variations: { | ||
'v=a': 5, // control | ||
'v=b': 5, // new layout, light | ||
'v=c': 5, // new layout, dark | ||
'v=d': 5, // notification favicon | ||
'v=e': 5 // monitor CTA | ||
} | ||
}); | ||
|
||
deckard.init(); | ||
} | ||
|
||
})(window.Mozilla); |
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