Last active
June 19, 2024 22:18
-
-
Save MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd to your computer and use it in GitHub Desktop.
Revisions
-
MahouShoujoMivutilde revised this gist
Jun 19, 2024 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1 @@ [install link](https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js) -
MahouShoujoMivutilde revised this gist
Mar 4, 2018 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ // @run-at document-end // @grant none // ==/UserScript== (function() { function MarkHTTP() { links_wrapper.removeEventListener('DOMNodeInserted', MarkHTTP, false); @@ -35,7 +35,6 @@ } // TODO: Запилить срабатывание на загрузку новой страницы при скролле, а не при вставкe ноды. var links_wrapper = document.getElementById('links'); links_wrapper.addEventListener('DOMNodeInserted', MarkHTTP, false); })(); -
MahouShoujoMivutilde revised this gist
Mar 4, 2018 . 1 changed file with 24 additions and 33 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,50 +1,41 @@ // ==UserScript== // @name HTTP in red on DuckDuckGo // @namespace HttpInRedOnDuckDuckGo // @version 0.3.0 // @updateURL https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js // @downloadURL https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js // @author MahouShoujoMivutilde // @match https://duckduckgo.com/* // @run-at document-end // @grant none // ==/UserScript== (function() { function MarkHTTP() { links_wrapper.removeEventListener('DOMNodeInserted', MarkHTTP, false); var start = performance.now(); var urls = links_wrapper.getElementsByClassName('result__url__domain'); for (i = 0; i < urls.length; ++i) { if (!/span/.test(urls[i].innerHTML)) { // Только те ноды, что еще не редактировались if (!/https/.test(urls[i].textContent)) { // Не https urls[i].insertAdjacentHTML('afterbegin', '<span style="color: #d50000; font-weight: bold">http</span>://'); } else { // https urls[i].textContent = urls[i].textContent.replace('https', ''); urls[i].insertAdjacentHTML('afterbegin', '<span style="font-weight: bold">https</span>'); } } } var finish = performance.now(); console.log(finish - start, 'ms'); links_wrapper.addEventListener('DOMNodeInserted', MarkHTTP, false); } // TODO: Запилить срабатывание на загрузку новой страницы при скролле, а не при вставкe ноды. // ...А то ненужная рекурсия, и безумная функция, которая срабатывает лишь в 33% от всех вызовов. var links_wrapper = document.getElementById('links'); links_wrapper.addEventListener('DOMNodeInserted', MarkHTTP, false); })(); -
MahouShoujoMivutilde revised this gist
Mar 4, 2018 . 2 changed files with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ // ==UserScript== // @name HTTP in red on DuckDuckGo // @namespace http://tampermonkey.net/ // @version 0.2.0 // @updateURL https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js // @downloadURL https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js // @author MahouShoujoMivutilde // @match https://duckduckgo.com/* // @grant none @@ -11,7 +13,6 @@ function init() { var links_wrapper = document.getElementById('links'); MarkHTTP(); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@  [install link](https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js) -
MahouShoujoMivutilde created this gist
Mar 4, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ // ==UserScript== // @name HTTP in red on DuckDuckGo // @namespace http://tampermonkey.net/ // @version 0.1.0 // @author MahouShoujoMivutilde // @match https://duckduckgo.com/* // @grant none // ==/UserScript== (function() { window.onload = init; function init() { var links_wrapper = document.getElementById('links'); var page_loaded = performance.now(); MarkHTTP(); function MarkHTTPWrapper() { if (performance.now() % 3 !== 0) { // вероятность этого, при условных 10000 мс пребывания на странице - 0.3334 return; } MarkHTTP(); } function MarkHTTP() { links_wrapper.removeEventListener("DOMNodeInserted", MarkHTTPWrapper, false); var start_search = performance.now(); var urls = links_wrapper.getElementsByClassName("result__url__domain"); for (i = 0; i < urls.length; ++i) { if (!/(http)/.test(urls[i].textContent)) { // Нет http или https urls[i].innerHTML = '<span style="color: #d50000; font-weight: bold">http</span>://' + urls[i].textContent; } else { urls[i].innerHTML = urls[i].innerHTML.replace("https", '<span style="font-weight: bold">https</span>'); } } var finish = performance.now(); console.log(finish - start_search, "ms"); links_wrapper.addEventListener("DOMNodeInserted", MarkHTTPWrapper, false); } // TODO: Запилить срабатывание на загрузку новой страницы при скролле, а не при вставкe ноды. // ...А то ненужная рекурсия, и безумная функция, которая срабатывает лишь в 33% от всех вызовов. links_wrapper.addEventListener("DOMNodeInserted", MarkHTTPWrapper, false); } })(); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <img src="https://i.imgur.com/ZraY3MU.png">