Bookmarklet Nirvana Test

JavaScript performance comparison

Test case created by Jakob Heuser

Info

Basis: http://help.nirvanahq.com/discussions/suggestions/17-bookmarklet

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<style>
pre { display: none; }
.nirvana-row { display: block; float: left; width: 100%; clear: both; }
</style>

<div class="nirvana-row">
  <p>Nirvana Email (This is from your account settings page)</p>
  <input type="text" id="nirvana-email"/>
</div>

<div class="nirvana-row">
  <p>Google Apps Domain? (enter the domain if you are a google apps person, IE "mycooldomain.com")</p>
  <input type="text" id="google-apps-domain"/>
</div>

<div class="nirvana-row">
  <button id="create">Create Bookmarklet</button>
</div>

<div class="nirvana-row">
  <p>Your bookmarklet will appear here: <span id="output"></span></p>
</div>

<div class="nirvana-row">
  <p>Then, drag the link to your bookmark bar</p>
</div>

<script type="text/javascript">
var raw_url = "javascript:(function(){m='http://mail.google.com/APP_DOMAINmail/?ui=1&view=cm&fs=1&tf=1&to=NIRVANA_EMAIL_ADDRESS&su='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(document.location);w=window.open(m,'addwindow','status=no,toolbar=no,width=575,height=545,resizable=yes');setTimeout(function(){w.focus();},%20250);})();";

$("#create").click(function() {

  var email = encodeURIComponent($("#nirvana-email").val()),
      apps = $("#google-apps-domain").val(),
      url = raw_url.replace("APP_DOMAIN", ((apps) ? "a/"+apps+"/" : "")).replace("NIRVANA_EMAIL_ADDRESS", email),
      node = document.createElement("a");
 
  node.innerHTML = "+Nirvana";
  node.href = url;
 
  $("#output").innerHTML = "";
 
  $("#output").append(node);
});

</script>

<br/><br/>

Preparation code output

Nirvana Email (This is from your account settings page)

Google Apps Domain? (enter the domain if you are a google apps person, IE "mycooldomain.com")

Your bookmarklet will appear here:

Then, drag the link to your bookmark bar



Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
1
1
pending…
2
2
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment