tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

common.js (634B)


      1 setup({explicit_done:true});
      2 
      3 function check(img) {
      4  var name = format_value(img.getAttribute('srcset'));
      5  if (img.hasAttribute('sizes')) {
      6    name += ' sizes=' + format_value(img.getAttribute('sizes'));
      7  }
      8  if (img.hasAttribute('data-desc')) {
      9    name += ' (' + img.getAttribute('data-desc') + ')';
     10  }
     11  test(function() {
     12    var expect = img.dataset.expect;
     13    if ('resolve' in img.dataset) {
     14      var a = document.createElement('a');
     15      a.href = expect;
     16      expect = a.href;
     17    }
     18    assert_equals(img.currentSrc, expect);
     19  }, name);
     20 }
     21 
     22 onload = function() {
     23  [].forEach.call(document.images, check);
     24  done();
     25 };