# Autogenerated config.py
#
# NOTE: config.py is intended for advanced users who are comfortable
# with manually migrating the config file on qutebrowser upgrades. If
# you prefer, you can also configure qutebrowser using the
# :set/:bind/:config-* commands without having to write a config.py
# file.
#
# Documentation:
#   qute://help/configuring.html
#   qute://help/settings.html

# Change the argument to True to still load settings configured via autoconfig.yml
config.load_autoconfig(False)

# Always restore open sites when qutebrowser is reopened. Without this
# option set, `:wq` (`:quit --save`) needs to be used to save open tabs
# (and restore them), while quitting qutebrowser in any other way will
# not save/restore the session. By default, this will save to the
# session which was last loaded. This behavior can be customized via the
# `session.default_name` setting.
# Type: Bool
c.auto_save.session = True

# Allow websites to read canvas elements. Note this is needed for some
# websites to work properly.
# Type: Bool
c.content.canvas_reading = False

# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`. If this setting is used with URL patterns, the pattern gets
# applied to the origin/first party URL of the page making the request,
# not the request URL. With QtWebEngine 5.15.0+, paths will be stripped
# from URLs, so URL patterns using paths will not match. With
# QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so
# you will typically need to set this setting for `example.com` when the
# cookie is set on `somesubdomain.example.com` for it to work properly.
# To debug issues with this setting, start qutebrowser with `--debug
# --logfilter network --debug-flag log-cookies` which will show all
# cookies being set.
# Type: String
# Valid values:
#   - all: Accept all cookies.
#   - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
#   - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
#   - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'chrome-devtools://*')

# Dark mode.
config.set('colors.webpage.darkmode.enabled', False)
config.set('colors.webpage.darkmode.threshold.background', 205)
config.set('colors.webpage.darkmode.threshold.text', 150)

# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`. If this setting is used with URL patterns, the pattern gets
# applied to the origin/first party URL of the page making the request,
# not the request URL. With QtWebEngine 5.15.0+, paths will be stripped
# from URLs, so URL patterns using paths will not match. With
# QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so
# you will typically need to set this setting for `example.com` when the
# cookie is set on `somesubdomain.example.com` for it to work properly.
# To debug issues with this setting, start qutebrowser with `--debug
# --logfilter network --debug-flag log-cookies` which will show all
# cookies being set.
# Type: String
# Valid values:
#   - all: Accept all cookies.
#   - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
#   - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
#   - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'devtools://*')

# Value to send in the `Accept-Language` header. Note that the value
# read from JavaScript is always the global value.
# Type: String
c.content.headers.accept_language = 'ja-JP,ja;q=0.9'

# Value to send in the `Accept-Language` header. Note that the value
# read from JavaScript is always the global value.
# Type: String
config.set('content.headers.accept_language', '', 'https://matchmaker.krunker.io/*')

# User agent to send.  The following placeholders are defined:  *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value   with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version.  The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine.  Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
#config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}', 'https://web.whatsapp.com/')

# User agent to send.  The following placeholders are defined:  *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value   with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version.  The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine.  Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
#config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version} Edg/{upstream_browser_version}', 'https://accounts.google.com/*')

# User agent to send.  The following placeholders are defined:  *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value   with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version.  The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine.  Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
#config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*')

# List of URLs to ABP-style adblocking rulesets.  Only used when Brave's
# ABP-style adblocker is used (see `content.blocking.method`).  You can
# find an overview of available lists here:
# https://adblockplus.org/en/subscriptions - note that the special
# `subscribe.adblockplus.org` links aren't handled by qutebrowser, you
# will instead need to find the link to the raw `.txt` file (e.g. by
# extracting it from the `location` parameter of the subscribe URL and
# URL-decoding it).
# Type: List of Url
c.content.blocking.adblock.lists = ['https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt', 'https://secure.fanboy.co.nz/fanboy-annoyance.txt', 'https://raw.githubusercontent.com/bogachenko/fuckfuckadblock/master/fuckfuckadblock.txt', 'https://www.i-dont-care-about-cookies.eu/abp/', 'https://abp.oisd.nl/']

c.content.blocking.hosts.lists = ["https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts", "https://git.076.ne.jp/TechnicalSuwako/anti-malware-hostfile/raw/branch/master/goolag", "https://git.076.ne.jp/TechnicalSuwako/anti-malware-hostfile/raw/branch/master/koukoku", "https://git.076.ne.jp/TechnicalSuwako/anti-malware-hostfile/raw/branch/master/massmediatube", "https://git.076.ne.jp/TechnicalSuwako/anti-malware-hostfile/raw/branch/master/fakebook", "https://git.076.ne.jp/TechnicalSuwako/anti-malware-hostfile/raw/branch/master/crimeflare", "https://git.076.ne.jp/TechnicalSuwako/anti-malware-hostfile/raw/branch/master/twitter"]

#c.content.headers.user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/QtWebEngine (KHTML, like Gecko) QtWebEngine/{qt_version} {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}"
#c.content.headers.user_agent = "Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {qt_key}/{qt_version} {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}"

# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'chrome-devtools://*')

# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'devtools://*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome-devtools://*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'devtools://*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome://*/*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'qute://*/*')

# Enable WebGL.
# Type: Bool
c.content.webgl = False

# Page to open if :open -t/-b/-w is used without URL. Use `about:blank`
# for a blank page.
# Type: FuzzyUrl
#c.url.default_page = 'https://search.076.ne.jp/'
c.url.default_page = 'https://www.technicalsuwako.jp'

# Search engines which can be used via the address bar.  Maps a search
# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}`
# placeholder. The placeholder will be replaced by the search term, use
# `{{` and `}}` for literal `{`/`}` braces.  The following further
# placeholds are defined to configure how special characters in the
# search terms are replaced by safe characters (called 'quoting'):  *
# `{}` and `{semiquoted}` quote everything except slashes; this is the
# most   sensible choice for almost all search engines (for the search
# term   `slash/and&amp` this placeholder expands to `slash/and%26amp`).
# * `{quoted}` quotes all characters (for `slash/and&amp` this
# placeholder   expands to `slash%2Fand%26amp`). * `{unquoted}` quotes
# nothing (for `slash/and&amp` this placeholder   expands to
# `slash/and&amp`). * `{0}` means the same as `{}`, but can be used
# multiple times.  The search engine named `DEFAULT` is used when
# `url.auto_search` is turned on and something else than a URL was
# entered to be opened. Other search engines can be used by prepending
# the search engine name to the search term, e.g. `:open google
# qutebrowser`.
# Type: Dict
#c.url.searchengines = {'DEFAULT': 'https://search.076.ne.jp/yacysearch.html?query={}'}
c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?q={}'}

# Page(s) to open at the start.
# Type: List of FuzzyUrl, or FuzzyUrl
#c.url.start_pages = 'https://search.076.ne.jp'
c.url.start_pages = 'https://www.technicalsuwako.jp'

# Custom key
config.bind('M', 'hint links spawn vlc {hint-url}') # 動画URLはVLCに開く
config.bind('Z', 'hint links spawn st -e yt-dlp {hint-url}') # YouTubeの動画URLを保存する
config.bind('t', ':set-cmd-text -s :open -t') # 新しいタブに開く
config.bind('pt', ':set-cmd-text -s :open -p') # 新しいURLをプライベートウィンドウに開く
config.bind('po', ':set-cmd-text -s :open -p {url}'); # 現在のURLをプライベートウィンドウに開く
config.bind('xb', 'config-cycle statusbar.show always never') # 下にある状況バーの有無
config.bind('xt', 'config-cycle tabs.show always never') #上にあるタブバーの有無
config.bind('xx', 'config-cycle statusbar.show always never;; config-cycle tabs.show always never') # 両方のバー同時にの有無
config.bind('xd', 'config-cycle colors.webpage.darkmode.enabled true false') # ダークモードの有無
config.bind('xj', 'config-cycle content.javascript.enabled true false') # JSの有無
config.bind('xp', 'config-cycle content.proxy system socks://localhost:9050/') # 普通↔Torの交換
config.bind(';i', 'hint images spawn --output-messages wget -P "/home/suwako/ダウンロード" {hint-url}') # 画像等の保存
config.bind('gh', 'back') # 戻る
config.bind('gl', 'forward') # 次
config.bind('ee', ':set-cmd-text -s :open {url}') # 現在のURLの編集

c.content.proxy = 'system'
c.content.javascript.enabled = True

# TODO: まだ機能していない
#config.set('content.javascript.enabled', True, '*://*.076.ne.jp/')
#config.set('content.javascript.enabled', True, '*://odysee.com/')
#config.set('content.javascript.enabled', True, '*://bitchute.com/')
#config.set('content.javascript.enabled', True, '*://tradeogre.com/')
#config.set('content.javascript.enabled', True, '*://app.slack.com/')

# Theme
c.colors.completion.category.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #46195a, stop:1 #341242)'
c.colors.completion.category.border.bottom = '#232629'
c.colors.completion.category.border.top = '#232629'
c.colors.completion.even.bg = '#232629'
c.colors.completion.item.selected.bg = '#61237c'
c.colors.completion.item.selected.border.bottom = '#cb81ea'
c.colors.completion.item.selected.border.top = '#cb81ea'
c.colors.completion.item.selected.fg = '#fcfcfc'
c.colors.completion.item.selected.match.fg = '#f31de8'
c.colors.completion.match.fg = '#f31de8'
c.colors.completion.odd.bg = '#31363b'
c.colors.completion.scrollbar.bg = '#31363b'
c.colors.completion.scrollbar.fg = '#cb81ea'

c.colors.downloads.bar.bg = '#31363b'
c.colors.downloads.error.bg = '#ff3636'
c.colors.downloads.error.fg = '#fcfcfc'
c.colors.downloads.start.bg = '#1d99f3'
c.colors.downloads.start.fg = '#fcfcfc'
c.colors.downloads.stop.bg = '#27ae60'
c.colors.downloads.stop.fg = '#fcfcfc'

c.colors.hints.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(234, 129, 232, 0.8), stop:1 rgba(229, 153, 229, 0.8))'
c.colors.hints.fg = '#fcfcfc'

c.colors.statusbar.command.bg = '#c0392b'
c.colors.statusbar.command.fg = '#fcfcfc'
c.colors.statusbar.command.private.bg = '#611e24'
c.colors.statusbar.command.private.fg = '#fcfcfc'

c.colors.statusbar.insert.bg = '#27ae60'
c.colors.statusbar.insert.fg = '#fcfcfc'
c.colors.statusbar.normal.bg = '#31363b'
c.colors.statusbar.normal.fg = '#fcfcfc'
c.colors.statusbar.passthrough.bg = '#1d99f3'
c.colors.statusbar.passthrough.fg = '#fcfcfc'
c.colors.statusbar.private.bg = '#6c29b9'
c.colors.statusbar.private.fg = '#fcfcfc'


c.colors.tabs.bar.bg = '#232629'
c.colors.tabs.even.bg = '#4d4d4d'
c.colors.tabs.even.fg = '#fcfcfc'
c.colors.tabs.indicator.error = '#ff3636'
c.colors.tabs.indicator.start = '#1d99f3'
c.colors.tabs.indicator.stop = '#27ae60'

c.colors.tabs.odd.bg = '#727272'
c.colors.tabs.odd.fg = '#fcfcfc'
c.colors.tabs.selected.even.bg = '#232629'
c.colors.tabs.selected.even.fg = '#fcfcfc'
c.colors.tabs.selected.odd.bg = '#232629'
c.colors.tabs.selected.odd.fg = '#fcfcfc'

c.hints.border = '1px solid #b459b6'

c.qt.force_software_rendering = 'qt-quick'
