comparison tweetdeck-large-image.user.js @ 109:ef21ef445fc6

Cleanups - wrap everything in function and call them last - fix namespace and update url
author nanaya <me@nanaya.net>
date Sun, 15 Jan 2023 23:33:41 +0900
parents 2c4470b73ad9
children
comparison
equal deleted inserted replaced
108:2c4470b73ad9 109:ef21ef445fc6
1 // ==UserScript== 1 // ==UserScript==
2 // @name Tweetdeck large image 2 // @name Tweetdeck large image
3 // @namespace https://myconan.net 3 // @namespace https://nanaya.net
4 // @version 2.0.9 4 // @version 2.0.9
5 // @description No more stupid link for images in tweetdeck 5 // @description No more stupid link for images in tweetdeck
6 // @author nanaya 6 // @author nanaya
7 // @match https://tweetdeck.twitter.com/* 7 // @match https://tweetdeck.twitter.com/*
8 // @grant none 8 // @grant none
9 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/tweetdeck-large-image.user.js 9 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/tweetdeck-large-image.user.js
10 // ==/UserScript== 10 // ==/UserScript==
11 11
12 (function () { 12 'use strict';
13 'use strict';
14 13
14 function origLink () {
15 const fix = function (link) { 15 const fix = function (link) {
16 // basic sanity check 16 // basic sanity check
17 if (!link.classList.contains('js-media-image-link')) { 17 if (!link.classList.contains('js-media-image-link')) {
18 return; 18 return;
19 } 19 }
80 80
81 // start the observer 81 // start the observer
82 observer.observe(document, { childList: true, subtree: true }); 82 observer.observe(document, { childList: true, subtree: true });
83 // initial run on existing document 83 // initial run on existing document
84 run(); 84 run();
85 }).call(); 85 }
86
87 origLink();