mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
Merge pull request #251 from dmitmel/master
[pull] master from dmitmel:master
This commit is contained in:
commit
ece2d929fb
8 changed files with 119 additions and 0 deletions
1
web/userscripts/README.md
Normal file
1
web/userscripts/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
[Tampermonkey](https://www.tampermonkey.net/) ([Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/), [Chrome extension](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo)) is recommended for loading these as it supports installing and updating userscripts from a remote URL.
|
17
web/userscripts/github-icon-vertical-align.user.js
Normal file
17
web/userscripts/github-icon-vertical-align.user.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
// ==UserScript==
|
||||
// @name GitHub icon vertical alignment fix
|
||||
// @version 2
|
||||
// @grant GM_addStyle
|
||||
// @match https://github.com/*
|
||||
// @match https://gist.github.com/*
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
(() => {
|
||||
'use strict';
|
||||
GM_addStyle(`
|
||||
.btn-sm .octicon {
|
||||
vertical-align: middle;
|
||||
}
|
||||
`);
|
||||
})();
|
19
web/userscripts/github-line-height.user.js
Normal file
19
web/userscripts/github-line-height.user.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
// ==UserScript==
|
||||
// @name GitHub line-height
|
||||
// @version 2
|
||||
// @grant GM_addStyle
|
||||
// @match https://github.com/*
|
||||
// @match https://gist.github.com/*
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
(() => {
|
||||
'use strict';
|
||||
const LINE_HEIGHT = '1.2';
|
||||
GM_addStyle(`
|
||||
.blob-num, .blob-code, .markdown-body .highlight pre, .markdown-body pre,
|
||||
.cm-s-github-light .CodeMirror-lines, textarea.file-editor-textarea {
|
||||
line-height: ${LINE_HEIGHT};
|
||||
}
|
||||
`);
|
||||
})();
|
19
web/userscripts/github-tab-size.user.js
Normal file
19
web/userscripts/github-tab-size.user.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
// ==UserScript==
|
||||
// @name GitHub tab size 4
|
||||
// @version 2
|
||||
// @grant GM_addStyle
|
||||
// @match https://github.com/*
|
||||
// @match https://gist.github.com/*
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
(() => {
|
||||
'use strict';
|
||||
const TAB_SIZE = '4';
|
||||
GM_addStyle(`
|
||||
* {
|
||||
-moz-tab-size: ${TAB_SIZE} !important;
|
||||
tab-size: ${TAB_SIZE} !important;
|
||||
}
|
||||
`);
|
||||
})();
|
16
web/userscripts/steamcommunity-com-linkfilter.user.js
Normal file
16
web/userscripts/steamcommunity-com-linkfilter.user.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
// ==UserScript==
|
||||
// @name steamcommunity.com linkfilter disabler
|
||||
// @version 1
|
||||
// @grant none
|
||||
// @run-at document-start
|
||||
// @match https://steamcommunity.com/linkfilter/*
|
||||
// ==/UserScript==
|
||||
|
||||
(() => {
|
||||
'use strict';
|
||||
let searchParams = new URLSearchParams(window.location.search);
|
||||
let url = searchParams.get('url');
|
||||
if (url) {
|
||||
window.location.replace(url);
|
||||
}
|
||||
})();
|
17
web/userscripts/twitter-s-param-remover.user.js
Normal file
17
web/userscripts/twitter-s-param-remover.user.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
// ==UserScript==
|
||||
// @name twitter ?s=20 remover
|
||||
// @version 1
|
||||
// @grant none
|
||||
// @match https://twitter.com/*
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
(() => {
|
||||
'use strict';
|
||||
let searchParams = new URLSearchParams(window.location.search);
|
||||
let strangeValue = searchParams.get('s');
|
||||
if (/[0-9]+/.test(strangeValue)) {
|
||||
searchParams.delete('s');
|
||||
window.location.search = searchParams.toString();
|
||||
}
|
||||
})();
|
30
web/userscripts/youtube-screenshot.user.js
Normal file
30
web/userscripts/youtube-screenshot.user.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
// ==UserScript==
|
||||
// @name YouTube screenshotter
|
||||
// @version 2
|
||||
// @grant GM_addElement
|
||||
// @match https://www.youtube.com/*
|
||||
// @run-at document-end
|
||||
// ==/UserScript==
|
||||
|
||||
(() => {
|
||||
'use strict';
|
||||
|
||||
function main() {
|
||||
window.__userscript__takeScreenshot = function (video, imageType = 'image/png') {
|
||||
if (!(video instanceof HTMLVideoElement)) {
|
||||
throw new Error('Assertion failed: video instanceof HTMLVideoElement');
|
||||
}
|
||||
|
||||
let canvas = document.createElement('canvas');
|
||||
canvas.width = video.videoWidth;
|
||||
canvas.height = video.videoHeight;
|
||||
let ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
|
||||
window.open(canvas.toDataURL(imageType), '_blank');
|
||||
};
|
||||
}
|
||||
|
||||
GM_addElement('script', {
|
||||
textContent: `(${main.toString()})();`,
|
||||
});
|
||||
})();
|
Loading…
Reference in a new issue