}
}
elsif ($file eq 'bug/edit.html.tmpl' || $file eq 'bug_modal/edit.html.tmpl') {
+ $vars->{firefox_versions} = _fetch_product_version_file('firefox', 1);
$vars->{split_cf_crash_signature} = $self->_split_crash_signature($vars);
}
}
}
-sub _get_product_version {
- my ($product, $channel, $detail) = @_;
+sub _fetch_product_version_file {
+ my ($product, $cache_only) = @_;
my $key = "${product}_versions";
my $versions = Bugzilla->request_cache->{$key}
|| Bugzilla->memcached->get_data({key => $key});
+ return $versions if $cache_only;
+
unless ($versions) {
my $ua = Mojo::UserAgent->new;
if (my $proxy_url = Bugzilla->params->{'proxy_url'}) {
});
}
+ return $versions;
+}
+
+sub _get_product_version {
+ my ($product, $channel, $detail) = @_;
+ my $versions = _fetch_product_version_file($product);
my $version = $versions->{PRODUCT_CHANNELS->{$product}->{$channel}->{json_key}};
return $version if $detail;
const VERSION = "0.4.0";
async function fetchProductDetails() {
+ const $meta = document.querySelector('meta[name="firefox-versions"]');
+
+ if ($meta) {
+ return JSON.parse($meta.content);
+ }
+
const url = "https://product-details.mozilla.org/1.0/firefox_versions.json";
const response = await fetch(url);
return await response.json();