lock title

Prevents a window's title from being set by the website.

  1. // ==UserScript==
  2. // @name lock title
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Prevents a window's title from being set by the website.
  6. // @author You
  7. // @license MIT
  8. // @match *://*/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. try {
  16. window.originalTitle = document.title; // save for future
  17. Object.defineProperty(document, 'title', {
  18. get: function() {return window.originalTitle},
  19. set: function() {}
  20. });
  21. } catch (e) {}
  22. })();