Greasy Fork is available in English.

gist update Description with title

gistの説明文を更新するとdocument.titleも更新

  1. // ==UserScript==
  2. // @name gist update Description with title
  3. // @namespace http://efcl.info/
  4. // @include http://gist.github.com/*
  5. // @include https://gist.github.com/*
  6. // @description gistの説明文を更新するとdocument.titleも更新
  7. // @author azu
  8. // @homepage http://efcl.info/
  9. // @twitter https://twitter.com/azu_re
  10. // @version 0.0.1.20140518104258
  11. // ==/UserScript==
  12.  
  13. // ==/UserScript==
  14. new function(){
  15. var desc = document.getElementById("gist-text-description");
  16. var descBt = document.getElementById("gist-edit-button");
  17. if(descBt){
  18. desc.addEventListener("DOMNodeInserted",function(e) {
  19. var {title} = document;
  20. title = title.replace(/-.*-/,"-");
  21. document.title = title.replace("-", "- "+ e.currentTarget.textContent + " -");
  22. },false);
  23. }
  24. }