Skip to content

Instantly share code, notes, and snippets.

@knz21
Created February 16, 2018 02:32
Show Gist options
  • Save knz21/1c01c1ed6cae5f3187c755d8b440c004 to your computer and use it in GitHub Desktop.
Save knz21/1c01c1ed6cae5f3187c755d8b440c004 to your computer and use it in GitHub Desktop.
Copy A/B test parameters from Firebase Console.
$('.mat-expansion-panel-header').click();
setTimeout(function () {
var $params = $('.variant-summary-content').find('.content-values');
var text = '';
$params.find('.header').find('.param-key').each(function (i, v) {
text += $(v).text().trim();
});
$params.find('.values').children().each(function (i, row) {
$(row).find('.param-value').each(function (j, v) {
text += $(v).text().trim();
});
});
var $span = $('<span>', { text: text });
$('body').append($span);
var range = document.createRange();
range.selectNodeContents($span[0]);
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
document.execCommand('copy');
selection.removeAllRanges();
$span.remove();
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment