9 changed files with 2552 additions and 0 deletions
@ -0,0 +1,4 @@ |
|||||
|
local.py |
||||
|
qsettings |
||||
|
bookmarks |
||||
|
quickmarks |
||||
@ -0,0 +1,20 @@ |
|||||
|
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser) |
||||
|
# Base16 qutebrowser template by theova |
||||
|
# Gruvbox dark, medium scheme by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) |
||||
|
|
||||
|
base00 = "#282828" |
||||
|
base01 = "#3c3836" |
||||
|
base02 = "#504945" |
||||
|
base03 = "#665c54" |
||||
|
base04 = "#bdae93" |
||||
|
base05 = "#d5c4a1" |
||||
|
base06 = "#ebdbb2" |
||||
|
base07 = "#fbf1c7" |
||||
|
base08 = "#fb4934" |
||||
|
base09 = "#fe8019" |
||||
|
base0A = "#fabd2f" |
||||
|
base0B = "#b8bb26" |
||||
|
base0C = "#8ec07c" |
||||
|
base0D = "#83a598" |
||||
|
base0E = "#d3869b" |
||||
|
base0F = "#d65d0e" |
||||
@ -0,0 +1,378 @@ |
|||||
|
import base16_gruvbox_dark_medium as b16 |
||||
|
from local import GPG_KEY, NOTIF_GRANTS |
||||
|
|
||||
|
# pylint: disable=C0111 |
||||
|
c = c # noqa: F821 pylint: disable=E0602,C0103 |
||||
|
config = config # noqa: F821 pylint: disable=E0602,C0103 |
||||
|
|
||||
|
######## |
||||
|
# Misc # |
||||
|
######## |
||||
|
|
||||
|
config.set("auto_save.session", True) |
||||
|
config.set("colors.webpage.preferred_color_scheme", "dark") |
||||
|
config.set("content.autoplay", False) |
||||
|
config.set("content.default_encoding", "utf-8") |
||||
|
config.set("content.pdfjs", False) |
||||
|
config.set("content.plugins", False) |
||||
|
config.set("downloads.location.directory", "~/dl") |
||||
|
config.set("session.lazy_restore", True) |
||||
|
config.set("tabs.background", True) |
||||
|
config.set("tabs.last_close", "close") |
||||
|
config.set("tabs.mousewheel_switching", False) |
||||
|
config.set("tabs.new_position.unrelated", "next") |
||||
|
config.set("tabs.position", "left") |
||||
|
config.set("tabs.show", "multiple") |
||||
|
config.set("tabs.width", "10%") |
||||
|
|
||||
|
############## |
||||
|
# Privileges # |
||||
|
############## |
||||
|
|
||||
|
# Cookies |
||||
|
config.set("content.cookies.accept", "never", "*://*.medium.com/*") |
||||
|
|
||||
|
# Media capture |
||||
|
config.set("content.media.audio_capture", True, "*://discord.com/*") |
||||
|
config.set("content.media.audio_video_capture", True, "*://discord.com/*") |
||||
|
config.set("content.media.video_capture", True, "*://discord.com/*") |
||||
|
|
||||
|
# Notifications |
||||
|
for pattern in NOTIF_GRANTS: |
||||
|
config.set("content.notifications.enabled", True, pattern) |
||||
|
config.set("content.notifications.enabled", True, "*://app.slack.com/*") |
||||
|
config.set("content.notifications.enabled", True, "*://discord.com/*") |
||||
|
config.set("content.notifications.enabled", False, "*://*.reddit.com/*") |
||||
|
|
||||
|
############ |
||||
|
# Bindings # |
||||
|
############ |
||||
|
|
||||
|
# Hinting |
||||
|
config.bind("F", "hint all tab-bg") |
||||
|
config.bind(";v", "hint links spawn playvideo {hint-url}") |
||||
|
config.bind(";i", "hint images download") |
||||
|
|
||||
|
config.bind("wi", "devtools window") |
||||
|
|
||||
|
# Keepass autotype |
||||
|
config.bind("<Alt-Shift-u>", |
||||
|
"spawn --userscript qute-keepassxc --key " + GPG_KEY, |
||||
|
mode="insert") |
||||
|
config.bind("pw", |
||||
|
"spawn --userscript qute-keepassxc --key " + GPG_KEY, |
||||
|
mode="normal") |
||||
|
|
||||
|
# Toggle socks proxy |
||||
|
config.bind("gp", |
||||
|
( |
||||
|
'config-cycle -t -p content.proxy ' |
||||
|
'"socks://127.0.0.1:8080/" ' |
||||
|
'"system"' |
||||
|
)) |
||||
|
|
||||
|
# Gruvbox dark theme hotswappable on demand |
||||
|
config.bind("<Ctrl-R>", |
||||
|
( |
||||
|
'config-cycle -t content.user_stylesheets ' |
||||
|
'"~/.config/qutebrowser/css/gruvbox-all-sites.css" ' |
||||
|
'""' |
||||
|
)) |
||||
|
|
||||
|
############## |
||||
|
# Adblocking # |
||||
|
############## |
||||
|
|
||||
|
config.set("content.blocking.enabled", True) |
||||
|
config.set("content.blocking.method", "adblock") |
||||
|
|
||||
|
config.set( |
||||
|
"content.blocking.adblock.lists", |
||||
|
[ |
||||
|
str(config.configdir) + "/custom-block.txt", |
||||
|
"https://easylist.to/easylist/easylist.txt", |
||||
|
"https://easylist.to/easylist/easyprivacy.txt", |
||||
|
# "https://easylist.to/easylist/fanboy-annoyance.txt", |
||||
|
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt", |
||||
|
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances.txt", |
||||
|
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt", |
||||
|
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt", |
||||
|
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt", |
||||
|
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt", |
||||
|
], |
||||
|
) |
||||
|
|
||||
|
############### |
||||
|
# Color theme # |
||||
|
############### |
||||
|
|
||||
|
# Text color of the completion widget. May be a single color to use for |
||||
|
# all columns or a list of three colors, one for each column. |
||||
|
c.colors.completion.fg = b16.base05 |
||||
|
|
||||
|
# Background color of the completion widget for odd rows. |
||||
|
c.colors.completion.odd.bg = b16.base03 |
||||
|
|
||||
|
# Background color of the completion widget for even rows. |
||||
|
c.colors.completion.even.bg = b16.base00 |
||||
|
|
||||
|
# Foreground color of completion widget category headers. |
||||
|
c.colors.completion.category.fg = b16.base0A |
||||
|
|
||||
|
# Background color of the completion widget category headers. |
||||
|
c.colors.completion.category.bg = b16.base00 |
||||
|
|
||||
|
# Top border color of the completion widget category headers. |
||||
|
c.colors.completion.category.border.top = b16.base00 |
||||
|
|
||||
|
# Bottom border color of the completion widget category headers. |
||||
|
c.colors.completion.category.border.bottom = b16.base00 |
||||
|
|
||||
|
# Foreground color of the selected completion item. |
||||
|
c.colors.completion.item.selected.fg = b16.base01 |
||||
|
|
||||
|
# Background color of the selected completion item. |
||||
|
c.colors.completion.item.selected.bg = b16.base0A |
||||
|
|
||||
|
# Top border color of the selected completion item. |
||||
|
c.colors.completion.item.selected.border.top = b16.base0A |
||||
|
|
||||
|
# Bottom border color of the selected completion item. |
||||
|
c.colors.completion.item.selected.border.bottom = b16.base0A |
||||
|
|
||||
|
# Foreground color of the matched text in the selected completion item. |
||||
|
c.colors.completion.item.selected.match.fg = b16.base08 |
||||
|
|
||||
|
# Foreground color of the matched text in the completion. |
||||
|
c.colors.completion.match.fg = b16.base0B |
||||
|
|
||||
|
# Color of the scrollbar handle in the completion view. |
||||
|
c.colors.completion.scrollbar.fg = b16.base05 |
||||
|
|
||||
|
# Color of the scrollbar in the completion view. |
||||
|
c.colors.completion.scrollbar.bg = b16.base00 |
||||
|
|
||||
|
# Background color of the context menu. If set to null, the Qt default is used. |
||||
|
c.colors.contextmenu.menu.bg = b16.base00 |
||||
|
|
||||
|
# Foreground color of the context menu. If set to null, the Qt default is used. |
||||
|
c.colors.contextmenu.menu.fg = b16.base05 |
||||
|
|
||||
|
# Background color of the context menu’s selected item. |
||||
|
# If set to null, the Qt default is used. |
||||
|
c.colors.contextmenu.selected.bg = b16.base0A |
||||
|
|
||||
|
# Foreground color of the context menu’s selected item. |
||||
|
# If set to null, the Qt default is used. |
||||
|
c.colors.contextmenu.selected.fg = b16.base01 |
||||
|
|
||||
|
# Background color for the download bar. |
||||
|
c.colors.downloads.bar.bg = b16.base00 |
||||
|
|
||||
|
# Color gradient start for download text. |
||||
|
c.colors.downloads.start.fg = b16.base00 |
||||
|
|
||||
|
# Color gradient start for download backgrounds. |
||||
|
c.colors.downloads.start.bg = b16.base0D |
||||
|
|
||||
|
# Color gradient end for download text. |
||||
|
c.colors.downloads.stop.fg = b16.base00 |
||||
|
|
||||
|
# Color gradient stop for download backgrounds. |
||||
|
c.colors.downloads.stop.bg = b16.base0C |
||||
|
|
||||
|
# Foreground color for downloads with errors. |
||||
|
c.colors.downloads.error.fg = b16.base08 |
||||
|
|
||||
|
# Font color for hints. |
||||
|
c.colors.hints.fg = b16.base00 |
||||
|
|
||||
|
# Background color for hints. Note that you can use a `rgba(...)` value |
||||
|
# for transparency. |
||||
|
c.colors.hints.bg = b16.base0A |
||||
|
|
||||
|
# Font color for the matched part of hints. |
||||
|
c.colors.hints.match.fg = b16.base05 |
||||
|
|
||||
|
# Text color for the keyhint widget. |
||||
|
c.colors.keyhint.fg = b16.base05 |
||||
|
|
||||
|
# Highlight color for keys to complete the current keychain. |
||||
|
c.colors.keyhint.suffix.fg = b16.base05 |
||||
|
|
||||
|
# Background color of the keyhint widget. |
||||
|
c.colors.keyhint.bg = b16.base00 |
||||
|
|
||||
|
# Foreground color of an error message. |
||||
|
c.colors.messages.error.fg = b16.base00 |
||||
|
|
||||
|
# Background color of an error message. |
||||
|
c.colors.messages.error.bg = b16.base08 |
||||
|
|
||||
|
# Border color of an error message. |
||||
|
c.colors.messages.error.border = b16.base08 |
||||
|
|
||||
|
# Foreground color of a warning message. |
||||
|
c.colors.messages.warning.fg = b16.base00 |
||||
|
|
||||
|
# Background color of a warning message. |
||||
|
c.colors.messages.warning.bg = b16.base0E |
||||
|
|
||||
|
# Border color of a warning message. |
||||
|
c.colors.messages.warning.border = b16.base0E |
||||
|
|
||||
|
# Foreground color of an info message. |
||||
|
c.colors.messages.info.fg = b16.base05 |
||||
|
|
||||
|
# Background color of an info message. |
||||
|
c.colors.messages.info.bg = b16.base00 |
||||
|
|
||||
|
# Border color of an info message. |
||||
|
c.colors.messages.info.border = b16.base00 |
||||
|
|
||||
|
# Foreground color for prompts. |
||||
|
c.colors.prompts.fg = b16.base05 |
||||
|
|
||||
|
# Border used around UI elements in prompts. |
||||
|
c.colors.prompts.border = b16.base00 |
||||
|
|
||||
|
# Background color for prompts. |
||||
|
c.colors.prompts.bg = b16.base00 |
||||
|
|
||||
|
# Background color for the selected item in filename prompts. |
||||
|
c.colors.prompts.selected.bg = b16.base0A |
||||
|
|
||||
|
# Foreground color of the statusbar. |
||||
|
c.colors.statusbar.normal.fg = b16.base0B |
||||
|
|
||||
|
# Background color of the statusbar. |
||||
|
c.colors.statusbar.normal.bg = b16.base00 |
||||
|
|
||||
|
# Foreground color of the statusbar in insert mode. |
||||
|
c.colors.statusbar.insert.fg = b16.base00 |
||||
|
|
||||
|
# Background color of the statusbar in insert mode. |
||||
|
c.colors.statusbar.insert.bg = b16.base0D |
||||
|
|
||||
|
# Foreground color of the statusbar in passthrough mode. |
||||
|
c.colors.statusbar.passthrough.fg = b16.base00 |
||||
|
|
||||
|
# Background color of the statusbar in passthrough mode. |
||||
|
c.colors.statusbar.passthrough.bg = b16.base0C |
||||
|
|
||||
|
# Foreground color of the statusbar in private browsing mode. |
||||
|
c.colors.statusbar.private.fg = b16.base00 |
||||
|
|
||||
|
# Background color of the statusbar in private browsing mode. |
||||
|
c.colors.statusbar.private.bg = b16.base03 |
||||
|
|
||||
|
# Foreground color of the statusbar in command mode. |
||||
|
c.colors.statusbar.command.fg = b16.base05 |
||||
|
|
||||
|
# Background color of the statusbar in command mode. |
||||
|
c.colors.statusbar.command.bg = b16.base00 |
||||
|
|
||||
|
# Foreground color of the statusbar in private browsing + command mode. |
||||
|
c.colors.statusbar.command.private.fg = b16.base05 |
||||
|
|
||||
|
# Background color of the statusbar in private browsing + command mode. |
||||
|
c.colors.statusbar.command.private.bg = b16.base00 |
||||
|
|
||||
|
# Foreground color of the statusbar in caret mode. |
||||
|
c.colors.statusbar.caret.fg = b16.base00 |
||||
|
|
||||
|
# Background color of the statusbar in caret mode. |
||||
|
c.colors.statusbar.caret.bg = b16.base0E |
||||
|
|
||||
|
# Foreground color of the statusbar in caret mode with a selection. |
||||
|
c.colors.statusbar.caret.selection.fg = b16.base00 |
||||
|
|
||||
|
# Background color of the statusbar in caret mode with a selection. |
||||
|
c.colors.statusbar.caret.selection.bg = b16.base0D |
||||
|
|
||||
|
# Background color of the progress bar. |
||||
|
c.colors.statusbar.progress.bg = b16.base0D |
||||
|
|
||||
|
# Default foreground color of the URL in the statusbar. |
||||
|
c.colors.statusbar.url.fg = b16.base05 |
||||
|
|
||||
|
# Foreground color of the URL in the statusbar on error. |
||||
|
c.colors.statusbar.url.error.fg = b16.base08 |
||||
|
|
||||
|
# Foreground color of the URL in the statusbar for hovered links. |
||||
|
c.colors.statusbar.url.hover.fg = b16.base05 |
||||
|
|
||||
|
# Foreground color of the URL in the statusbar on successful load |
||||
|
# (http). |
||||
|
c.colors.statusbar.url.success.http.fg = b16.base0C |
||||
|
|
||||
|
# Foreground color of the URL in the statusbar on successful load |
||||
|
# (https). |
||||
|
c.colors.statusbar.url.success.https.fg = b16.base0B |
||||
|
|
||||
|
# Foreground color of the URL in the statusbar when there's a warning. |
||||
|
c.colors.statusbar.url.warn.fg = b16.base0E |
||||
|
|
||||
|
# Background color of the tab bar. |
||||
|
c.colors.tabs.bar.bg = b16.base00 |
||||
|
|
||||
|
# Color gradient start for the tab indicator. |
||||
|
c.colors.tabs.indicator.start = b16.base0D |
||||
|
|
||||
|
# Color gradient end for the tab indicator. |
||||
|
c.colors.tabs.indicator.stop = b16.base0C |
||||
|
|
||||
|
# Color for the tab indicator on errors. |
||||
|
c.colors.tabs.indicator.error = b16.base08 |
||||
|
|
||||
|
# Foreground color of unselected odd tabs. |
||||
|
c.colors.tabs.odd.fg = b16.base05 |
||||
|
|
||||
|
# Background color of unselected odd tabs. |
||||
|
c.colors.tabs.odd.bg = b16.base03 |
||||
|
|
||||
|
# Foreground color of unselected even tabs. |
||||
|
c.colors.tabs.even.fg = b16.base05 |
||||
|
|
||||
|
# Background color of unselected even tabs. |
||||
|
c.colors.tabs.even.bg = b16.base00 |
||||
|
|
||||
|
# Background color of pinned unselected even tabs. |
||||
|
c.colors.tabs.pinned.even.bg = b16.base0C |
||||
|
|
||||
|
# Foreground color of pinned unselected even tabs. |
||||
|
c.colors.tabs.pinned.even.fg = b16.base07 |
||||
|
|
||||
|
# Background color of pinned unselected odd tabs. |
||||
|
c.colors.tabs.pinned.odd.bg = b16.base0B |
||||
|
|
||||
|
# Foreground color of pinned unselected odd tabs. |
||||
|
c.colors.tabs.pinned.odd.fg = b16.base07 |
||||
|
|
||||
|
# Background color of pinned selected even tabs. |
||||
|
c.colors.tabs.pinned.selected.even.bg = b16.base05 |
||||
|
|
||||
|
# Foreground color of pinned selected even tabs. |
||||
|
c.colors.tabs.pinned.selected.even.fg = b16.base00 |
||||
|
|
||||
|
# Background color of pinned selected odd tabs. |
||||
|
c.colors.tabs.pinned.selected.odd.bg = b16.base05 |
||||
|
|
||||
|
# Foreground color of pinned selected odd tabs. |
||||
|
c.colors.tabs.pinned.selected.odd.fg = b16.base0E |
||||
|
|
||||
|
# Foreground color of selected odd tabs. |
||||
|
c.colors.tabs.selected.odd.fg = b16.base00 |
||||
|
|
||||
|
# Background color of selected odd tabs. |
||||
|
c.colors.tabs.selected.odd.bg = b16.base05 |
||||
|
|
||||
|
# Foreground color of selected even tabs. |
||||
|
c.colors.tabs.selected.even.fg = b16.base00 |
||||
|
|
||||
|
# Background color of selected even tabs. |
||||
|
c.colors.tabs.selected.even.bg = b16.base05 |
||||
|
|
||||
|
# Background color for webpages if unset (or empty to use the theme's |
||||
|
# color). |
||||
|
# c.colors.webpage.bg = b16.base00 |
||||
File diff suppressed because it is too large
@ -0,0 +1,3 @@ |
|||||
|
||*.youtube.com |
||||
|
||tweetdeck.twitter.com |
||||
|
||twitter.com |
||||
@ -0,0 +1,332 @@ |
|||||
|
// ==UserScript==
|
||||
|
// @name Direct links out
|
||||
|
// @name:ru Прямые ссылки наружу
|
||||
|
// @description Removes all "You are leaving our site" and redirection stuff from links
|
||||
|
// @description:ru Убирает "Бла-бла-бла, Вы покидаете наш сайт" и переадресации из ссылок
|
||||
|
// @namespace https://github.com/nokeya
|
||||
|
// @author nokeya
|
||||
|
// @update https://github.com/nokeya/direct-links-out/raw/master/direct-links-out.user.js
|
||||
|
// @icon https://raw.githubusercontent.com/nokeya/direct-links-out/master/icon.png
|
||||
|
// @version 2.19
|
||||
|
// @grant none
|
||||
|
//google
|
||||
|
// @include *://google.*
|
||||
|
// @include *://www.google.*
|
||||
|
// @include *://encrypted.google.*
|
||||
|
//yandex
|
||||
|
// @match *://yandex.ru/*
|
||||
|
// @match *://yandex.ua/*
|
||||
|
// @match *://yandex.by/*
|
||||
|
// @match *://yandex.kz/*
|
||||
|
// @match *://yandex.com.tr/*
|
||||
|
// @match *://yandex.com/*
|
||||
|
// @match *://*.yandex.ru/*
|
||||
|
// @match *://*.yandex.ua/*
|
||||
|
// @match *://*.yandex.by/*
|
||||
|
// @match *://*.yandex.kz/*
|
||||
|
// @match *://*.yandex.com.tr/*
|
||||
|
// @match *://*.yandex.com/*
|
||||
|
//youtube
|
||||
|
// @match *://youtube.com/*
|
||||
|
// @match *://*.youtube.com/*
|
||||
|
//wikimapia
|
||||
|
// @match *://wikimapia.org/*
|
||||
|
//deviantart
|
||||
|
// @match *://deviantart.com/*
|
||||
|
// @match *://*.deviantart.com/*
|
||||
|
//joyreactor
|
||||
|
// @match *://joyreactor.cc/*
|
||||
|
// @match *://*.joyreactor.cc/*
|
||||
|
// @match *://reactor.cc/*
|
||||
|
// @match *://*.reactor.cc/*
|
||||
|
// @match *://joyreactor.com/*
|
||||
|
// @match *://*.joyreactor.com/*
|
||||
|
//vk
|
||||
|
// @match *://vk.com/*
|
||||
|
// @match *://*.vk.com/*
|
||||
|
//ok
|
||||
|
// @match *://ok.ru/*
|
||||
|
// @match *://*.ok.ru/*
|
||||
|
//steam
|
||||
|
// @match *://steamcommunity.com/*
|
||||
|
// @match *://*.steamcommunity.com/*
|
||||
|
//fb
|
||||
|
// @match *://facebook.com/*
|
||||
|
// @match *://*.facebook.com/*
|
||||
|
//twitter
|
||||
|
// @match *://twitter.com/*
|
||||
|
// @match *://*.twitter.com/*
|
||||
|
//4pda
|
||||
|
// @match *://4pda.ru/*
|
||||
|
// @match *://*.4pda.ru/*
|
||||
|
//kickass
|
||||
|
// @match *://kat.cr/*
|
||||
|
// @match *://kickassto.co/*
|
||||
|
// @match *://katproxy.is/*
|
||||
|
// @match *://thekat.tv/*
|
||||
|
// @match *://*.kat.cr/*
|
||||
|
// @match *://*.kickassto.co/*
|
||||
|
// @match *://*.katproxy.is/*
|
||||
|
// @match *://*.thekat.tv/*
|
||||
|
//AMO
|
||||
|
// @match *://addons.mozilla.org/*
|
||||
|
//pixiv
|
||||
|
// @match *://pixiv.net/*
|
||||
|
// @match *://*.pixiv.net/*
|
||||
|
//tumblr
|
||||
|
// @match *://tumblr.com/*
|
||||
|
// @match *://*.tumblr.com/*
|
||||
|
//danieldefo
|
||||
|
// @match *://danieldefo.ru/*
|
||||
|
// @match *://*.danieldefo.ru/*
|
||||
|
//yaplakal
|
||||
|
// @match *://yaplakal.com/*
|
||||
|
// @match *://*.yaplakal.com/*
|
||||
|
//soundcloud
|
||||
|
// @match *://soundcloud.com/*
|
||||
|
// @match *://*.soundcloud.com/*
|
||||
|
//upwork
|
||||
|
// @match *://upwork.com/*
|
||||
|
// @match *://*.upwork.com/*
|
||||
|
//picarto
|
||||
|
// @match *://picarto.tv/*
|
||||
|
// @match *://*.picarto.tv/*
|
||||
|
//taker
|
||||
|
// @match *://taker.im/*
|
||||
|
// @match *://*.taker.im/*
|
||||
|
//forumavia
|
||||
|
// @match *://*.forumavia.ru/*
|
||||
|
//slack
|
||||
|
// @match *://*.slack.com/*
|
||||
|
//instagram
|
||||
|
// @match *://instagram.com/*
|
||||
|
// @match *://*.instagram.com/*
|
||||
|
|
||||
|
// ==/UserScript==
|
||||
|
(function() { |
||||
|
// anchors and functions
|
||||
|
var anchor; |
||||
|
var after; |
||||
|
var rwLink = function(){}; |
||||
|
var rwAll = function(){}; |
||||
|
var retTrue = function() { return true; }; //dummy function to always return true
|
||||
|
|
||||
|
// simple rewrite link - based on anchors
|
||||
|
function rwSimple(link){ |
||||
|
if (anchor){ |
||||
|
var ndx = link.href.indexOf(anchor); |
||||
|
if (ndx != -1){ |
||||
|
var newlink = link.href.substring(ndx + anchor.length); |
||||
|
if (after){ |
||||
|
ndx = newlink.indexOf(after); |
||||
|
if (ndx != -1) |
||||
|
newlink = newlink.substring(0, ndx); |
||||
|
} |
||||
|
link.href = unescape(newlink); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
function rwaSimple(){ |
||||
|
var links = document.getElementsByTagName('a'); |
||||
|
for (var i = 0; i < links.length; ++i) |
||||
|
rwLink(links[i]); |
||||
|
} |
||||
|
// vk
|
||||
|
function rwVK(link){ |
||||
|
if (link.className === 'page_media_link_thumb') |
||||
|
{ |
||||
|
var parent = link.parentNode; |
||||
|
link.href = parent.getAttribute("href"); |
||||
|
parent.removeAttribute('href'); |
||||
|
parent.removeAttribute('onclick'); |
||||
|
link.removeAttribute('onclick'); |
||||
|
} |
||||
|
|
||||
|
var ndx = link.href.indexOf(anchor); |
||||
|
if (ndx != -1){ |
||||
|
var newlink = link.href.substring(ndx + anchor.length); |
||||
|
var afterArr = ['&post=', '&el=snippet', '&cc_key=']; |
||||
|
for (var i = 0; i < afterArr.length; ++i){ |
||||
|
ndx = newlink.indexOf(afterArr[i]); |
||||
|
if (ndx != -1) |
||||
|
newlink = newlink.substring(0, ndx); |
||||
|
} |
||||
|
link.href = unescape(newlink); |
||||
|
} |
||||
|
} |
||||
|
// twitter
|
||||
|
function rwTwitter(link){ |
||||
|
if (link.hasAttribute('data-expanded-url')){ |
||||
|
link.href = link.getAttribute('data-expanded-url'); |
||||
|
link.removeAttribute('data-expanded-url'); |
||||
|
} |
||||
|
} |
||||
|
function rwaTwitter(){ |
||||
|
var links = document.getElementsByClassName('twitter-timeline-link'); |
||||
|
for (var i = 0; i < links.length; ++i) |
||||
|
rwLink(links[i]); |
||||
|
} |
||||
|
// kickass
|
||||
|
function rwKickass(link){ |
||||
|
var ndx = link.href.indexOf(anchor); |
||||
|
if (ndx != -1){ |
||||
|
link.href = window.atob(unescape(link.href.substring(ndx + anchor.length, link.href.length - 1))); |
||||
|
link.className = ''; |
||||
|
} |
||||
|
} |
||||
|
// youtube
|
||||
|
function rwYoutube(link){ |
||||
|
if (/redirect/i.test(link.className)) |
||||
|
link.setAttribute('data-redirect-href-updated', 'true'); |
||||
|
rwSimple(link); |
||||
|
} |
||||
|
// facebook
|
||||
|
function rwFacebook(link){ |
||||
|
if (/referrer_log/i.test(link.onclick)){ |
||||
|
link.removeAttribute('onclick'); |
||||
|
link.removeAttribute('onmouseover'); |
||||
|
} |
||||
|
rwSimple(link); |
||||
|
} |
||||
|
// google
|
||||
|
function rwGoogle(link){ |
||||
|
// replace global rwt script
|
||||
|
if (window.rwt && window.rwt != retTrue){ |
||||
|
delete window.rwt; |
||||
|
Object.defineProperty(window, 'rwt', { value: retTrue, writable: false }); |
||||
|
} |
||||
|
|
||||
|
// main search
|
||||
|
if (link.hasAttribute('onmousedown')) |
||||
|
link.removeAttribute('onmousedown'); |
||||
|
// images
|
||||
|
if (link.hasAttribute('jsaction')){ |
||||
|
var tmp = link.getAttribute('jsaction'); |
||||
|
if (tmp) |
||||
|
link.setAttribute('jsaction', tmp.replace(/(mousedown:irc.rl|keydown:irc.rlk)/g,'')); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// yandex
|
||||
|
function rwYandex(link){ |
||||
|
// main search
|
||||
|
if (link.hasAttribute('onmousedown')) |
||||
|
link.removeAttribute('onmousedown'); |
||||
|
// images
|
||||
|
anchor = '&img_url='; |
||||
|
after = '&pos='; |
||||
|
rwSimple(link); |
||||
|
} |
||||
|
//mozilla addons store
|
||||
|
function rwAMO(link){ |
||||
|
if (/outgoing.prod.mozaws.net/i.test(link.href)){ |
||||
|
var tmp = link.href; |
||||
|
link.href = "#"; |
||||
|
// we have to fight mozilla's replacing of direct redirect string with jquery events
|
||||
|
setTimeout(function(){ link.href = unescape(tmp.replace(/(http|https):\/\/outgoing.prod.mozaws.net\/v1\/[0-9a-zA-Z]+\//i,'')); }, 100); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// daniueldefo
|
||||
|
function rwDanielDefo(link){ |
||||
|
if (link.hasAttribute('data-proxy-href')) |
||||
|
link.removeAttribute('data-proxy-href'); |
||||
|
} |
||||
|
|
||||
|
// slack
|
||||
|
function rwSlack(link){ |
||||
|
link.removeAttribute('onclick'); |
||||
|
link.removeAttribute('onmouseover'); |
||||
|
} |
||||
|
|
||||
|
// determine anchors, functions and listeners
|
||||
|
(function () |
||||
|
{ |
||||
|
rwLink = rwSimple; |
||||
|
rwAll = rwaSimple; |
||||
|
|
||||
|
var loc = window.location.hostname; |
||||
|
if (/google/i.test(loc)) |
||||
|
rwLink = rwGoogle; |
||||
|
else if (/youtube/i.test(loc)){ |
||||
|
anchor = 'redirect?q='; |
||||
|
after = '&redir_token='; |
||||
|
rwLink = rwYoutube; |
||||
|
} |
||||
|
else if (/facebook/i.test(loc)){ |
||||
|
anchor = 'u='; |
||||
|
after = '&h='; |
||||
|
rwLink = rwFacebook; |
||||
|
} |
||||
|
else if (/instagram/i.test(loc)){ |
||||
|
anchor = 'u='; |
||||
|
after = '&e='; |
||||
|
} |
||||
|
else if (/twitter/i.test(loc)){ |
||||
|
rwLink = rwTwitter; |
||||
|
rwAll = rwaTwitter; |
||||
|
} |
||||
|
else if (/yandex/i.test(loc)) |
||||
|
rwLink = rwYandex; |
||||
|
else if (/vk/i.test(loc)){ |
||||
|
anchor = 'to='; |
||||
|
rwLink = rwVK; |
||||
|
} |
||||
|
else if (/ok/i.test(loc)){ |
||||
|
anchor = 'st.link='; |
||||
|
after = '&st.name='; |
||||
|
} |
||||
|
else if (/pixiv/i.test(loc)) |
||||
|
anchor = 'jump.php?'; |
||||
|
else if (/tumblr/i.test(loc)){ |
||||
|
anchor = "redirect?z="; |
||||
|
after = "&t="; |
||||
|
} |
||||
|
else if (/deviantart/i.test(loc)) |
||||
|
anchor = 'outgoing?'; |
||||
|
else if (/(steam|reactor)/i.test(loc)) |
||||
|
anchor = 'url='; |
||||
|
else if (/(kat|kickass)/i.test(loc)){ |
||||
|
anchor = 'confirm/url/'; |
||||
|
rwLink = rwKickass; |
||||
|
} |
||||
|
else if (/soundcloud/i.test(loc)) |
||||
|
anchor = "exit.sc/?url="; |
||||
|
else if (/upwork/i.test(loc)) |
||||
|
anchor = 'leaving-odesk?ref='; |
||||
|
else if (/4pda/i.test(loc)){ |
||||
|
anchor = 'go/?u='; |
||||
|
after = '&e='; |
||||
|
} |
||||
|
else if (/mozilla/i.test(loc)) |
||||
|
rwLink = rwAMO; |
||||
|
else if (/danieldefo/i.test(loc)) |
||||
|
rwLink = rwDanielDefo; |
||||
|
else if (/yaplakal/i.test(loc)) |
||||
|
anchor = "go/?"; |
||||
|
else if (/wikimapia.org/i.test(loc)) |
||||
|
anchor = 'external_link?url='; |
||||
|
else if (/forumavia.ru/i.test(loc)) |
||||
|
anchor = '/e/?l='; |
||||
|
else if (/picarto/i.test(loc)){ |
||||
|
anchor = "referrer?go="; |
||||
|
after = "&ref="; |
||||
|
} |
||||
|
else if (/taker/i.test(loc)) |
||||
|
anchor = "phpBB2/goto/"; |
||||
|
else if (/slack/i.test(loc)) |
||||
|
rwLink = rwSlack; |
||||
|
|
||||
|
document.addEventListener('DOMNodeInserted', function(event){ |
||||
|
if (!event || !event.target || !(event.target instanceof HTMLElement)) |
||||
|
return; |
||||
|
var node = event.target; |
||||
|
if (node instanceof HTMLAnchorElement) |
||||
|
rwLink(node); |
||||
|
var links = node.getElementsByTagName('a'); |
||||
|
for (var i = 0; i < links.length; ++i) |
||||
|
rwLink(links[i]); |
||||
|
}, false); |
||||
|
})(); |
||||
|
rwAll(); |
||||
|
})(); |
||||
@ -0,0 +1,79 @@ |
|||||
|
// https://github.com/joeywatts/disable-autogain-control-extension/blob/master/disableAutogain.js
|
||||
|
(function() { |
||||
|
function setLegacyChromeConstraint(constraint, name, value) { |
||||
|
if (constraint.mandatory && name in constraint.mandatory) { |
||||
|
constraint.mandatory[name] = value; |
||||
|
return; |
||||
|
} |
||||
|
if (constraint.optional) { |
||||
|
const element = constraint.optional.find(opt => name in opt); |
||||
|
if (element) { |
||||
|
element[name] = value; |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
// `mandatory` options throw errors for unknown keys, so avoid that by
|
||||
|
// setting it under optional.
|
||||
|
if (!constraint.optional) { |
||||
|
constraint.optional = []; |
||||
|
} |
||||
|
constraint.optional.push({ [name]: value }); |
||||
|
} |
||||
|
function setConstraint(constraint, name, value) { |
||||
|
if (constraint.advanced) { |
||||
|
const element = constraint.advanced.find(opt => name in opt); |
||||
|
if (element) { |
||||
|
element[name] = value; |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
constraint[name] = value; |
||||
|
} |
||||
|
function disableAutogain(constraints) { |
||||
|
console.log("Automatically unsetting gain!", constraints); |
||||
|
if (constraints && constraints.audio) { |
||||
|
if (typeof constraints.audio !== "object") { |
||||
|
constraints.audio = {}; |
||||
|
} |
||||
|
if (constraints.audio.optional || constraints.audio.mandatory) { |
||||
|
setLegacyChromeConstraint(constraints.audio, "googAutoGainControl", false); |
||||
|
setLegacyChromeConstraint(constraints.audio, "googAutoGainControl2", false); |
||||
|
} else { |
||||
|
setConstraint(constraints.audio, "autoGainControl", false); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function patchFunction(object, name, createNewFunction) { |
||||
|
if (name in object) { |
||||
|
var original = object[name]; |
||||
|
object[name] = createNewFunction(original); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
patchFunction(navigator.mediaDevices, "getUserMedia", function (original) { |
||||
|
return function getUserMedia(constraints) { |
||||
|
disableAutogain(constraints); |
||||
|
return original.call(this, constraints); |
||||
|
}; |
||||
|
}); |
||||
|
function patchDeprecatedGetUserMedia(original) { |
||||
|
return function getUserMedia(constraints, success, error) { |
||||
|
disableAutogain(constraints); |
||||
|
return original.call(this, constraints, success, error); |
||||
|
}; |
||||
|
} |
||||
|
patchFunction(navigator, "getUserMedia", patchDeprecatedGetUserMedia); |
||||
|
patchFunction(navigator, "mozGetUserMedia", patchDeprecatedGetUserMedia); |
||||
|
patchFunction(navigator, "webkitGetUserMedia", patchDeprecatedGetUserMedia); |
||||
|
patchFunction(MediaStreamTrack.prototype, "applyConstraints", function (original) { |
||||
|
return function applyConstraints(constraints) { |
||||
|
disableAutogain(constraints); |
||||
|
return original.call(this, constraints); |
||||
|
}; |
||||
|
}); |
||||
|
console.log( |
||||
|
"Disable Autogain by Joey Watts!", |
||||
|
navigator.mediaDevices.getUserMedia |
||||
|
); |
||||
|
})(); |
||||
@ -0,0 +1,15 @@ |
|||||
|
// ==UserScript==
|
||||
|
// @name Nitter redirector
|
||||
|
// @namespace https://gist.github.com/bitraid/d1901de54382532a03b9b22a207f0417
|
||||
|
// @version 1.0
|
||||
|
// @description reddit to teddit
|
||||
|
// @match *://*.twitter.com/*
|
||||
|
// @match *://twitter.com/*
|
||||
|
// @grant none
|
||||
|
// @run-at document-start
|
||||
|
// ==/UserScript==
|
||||
|
|
||||
|
(function () { |
||||
|
'use strict'; |
||||
|
top.location.hostname = "nitter.pussthecat.org"; |
||||
|
})(); |
||||
@ -0,0 +1,7 @@ |
|||||
|
GPG_KEY = "D1D400EBE283A278E72A6ED40FDA27891A60E157" |
||||
|
NOTIF_GRANTS = [ |
||||
|
"*://example.com/*", |
||||
|
"*://cool.website/*", |
||||
|
] |
||||
|
|
||||
|
# vim: syntax=python |
||||
Loading…
Reference in new issue