SE Timeline link

Adds a timeline link for the questions

  1. // ==UserScript==
  2. // @name SE Timeline link
  3. // @description Adds a timeline link for the questions
  4. // @version 1.0.1
  5. // @author wOxxOm
  6. // @namespace wOxxOm.scripts
  7. // @license MIT License
  8. // @match *://*.stackoverflow.com/questions/*
  9. // @match *://*.superuser.com/questions/*
  10. // @match *://*.serverfault.com/questions/*
  11. // @match *://*.askubuntu.com/questions/*
  12. // @match *://*.stackapps.com/questions/*
  13. // @match *://*.mathoverflow.com/questions/*
  14. // @match *://*.stackexchange.com/questions/*
  15. // @exclude /\.com\/questions\/\D/
  16. // @run-at document-start
  17. // @require https://greatest.deepsurf.us/scripts/12228/code/setMutationHandler.js
  18. // ==/UserScript==
  19.  
  20. var id = location.pathname.match(/\d+/)[0];
  21. setMutationHandler('#link-post-' + id, nodes => {
  22. nodes[0].parentElement.insertAdjacentHTML(
  23. 'beforeend',
  24. '<span class="lsep">|</span>' +
  25. `<a href="/posts/${id}/timeline">timeline</a>`
  26. );
  27. return false;
  28. });