Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
@@ -8,13 +8,13 @@ local unique_instance = require "unique_instance"
|
||||
unique_instance.open_links_in_new_window = true
|
||||
|
||||
-- Set the number of web processes to use. A value of 0 means 'no limit'.
|
||||
luakit.process_limit = 8
|
||||
luakit.process_limit = 1
|
||||
|
||||
-- Load library of useful functions for luakit
|
||||
local lousy = require "lousy"
|
||||
|
||||
-- Cookie acceptance policy
|
||||
soup.accept_policy = "always" -- always, never, no_third_party
|
||||
soup.accept_policy = "no_third_party" -- always, never, no_third_party
|
||||
|
||||
-- Cookie storage location
|
||||
soup.cookies_storage = luakit.data_dir .. "/cookies.db"
|
||||
@@ -36,10 +36,10 @@ window.add_signal("build", function (w)
|
||||
local widgets, l, r = require "lousy.widget", w.sbar.l, w.sbar.r
|
||||
|
||||
-- Left-aligned status bar widgets
|
||||
l.layout:pack(widgets.zoom())
|
||||
l.layout:pack(widgets.uri())
|
||||
l.layout:pack(widgets.hist())
|
||||
l.layout:pack(widgets.progress())
|
||||
l.layout:pack(widgets.zoom())
|
||||
|
||||
-- Right-aligned status bar widgets
|
||||
r.layout:pack(widgets.buf())
|
||||
@@ -58,28 +58,28 @@ local settings = require "settings"
|
||||
local settings_chrome = require "settings_chrome"
|
||||
|
||||
settings.window.home_page = "luakit://newtab"
|
||||
settings.window.scroll_step = 20
|
||||
-- settings.window.scroll_step = 20
|
||||
settings.window.zoom_step = 0.2
|
||||
settings.webview.zoom_level = 100
|
||||
settings.window.close_with_last_tab = true
|
||||
|
||||
-- search engines
|
||||
settings.window.search_engines.ddg = "https://duckduckgo.com/?q=%s"
|
||||
settings.window.search_engines.g = "https://google.com/?q=%s"
|
||||
settings.window.search_engines.mg = "https://metager.org/?q=%s"
|
||||
settings.window.search_engines.gh = "https://github.com/search?q=%s"
|
||||
settings.window.search_engines.default = settings.window.search_engines.ddg
|
||||
settings.window.search_engines.g = "https://google.com/?q=%s"
|
||||
settings.window.search_engines.mg = "https://metager.org/?q=%s"
|
||||
settings.window.search_engines.gh = "https://github.com/search?q=%s"
|
||||
settings.window.search_engines.default = settings.window.search_engines.ddg
|
||||
|
||||
----------------------------------
|
||||
-- Optional user script loading --
|
||||
----------------------------------
|
||||
|
||||
-- Add adblock
|
||||
local adblock = require "adblock"
|
||||
local adblock_chrome = require "adblock_chrome"
|
||||
-- local adblock = require "adblock"
|
||||
-- local adblock_chrome = require "adblock_chrome"
|
||||
|
||||
-- Enable Developer Tools
|
||||
local webinspector = require "webinspector"
|
||||
-- local webinspector = require "webinspector"
|
||||
|
||||
-- Add uzbl-like form filling
|
||||
-- local formfiller = require "formfiller"
|
||||
@@ -88,7 +88,7 @@ local webinspector = require "webinspector"
|
||||
-- })
|
||||
|
||||
-- Add proxy support & manager
|
||||
local proxy = require "proxy"
|
||||
-- local proxy = require "proxy"
|
||||
|
||||
-- Add quickmarks support & manager
|
||||
-- local quickmarks = require "quickmarks"
|
||||
@@ -100,13 +100,13 @@ local proxy = require "proxy"
|
||||
local gopher = require "gopher"
|
||||
|
||||
-- Delete website data
|
||||
local clear_data = require "clear_data"
|
||||
-- local clear_data = require "clear_data"
|
||||
|
||||
-- Add command to list closed tabs & bind to open closed tabs
|
||||
local undoclose = require "undoclose"
|
||||
|
||||
-- Add command to list tab history items
|
||||
local tabhistory = require "tabhistory"
|
||||
-- local tabhistory = require "tabhistory"
|
||||
|
||||
-- Add greasemonkey-like javascript userscript support
|
||||
--- local userscripts = require "userscripts"
|
||||
@@ -121,7 +121,7 @@ local downloads_chrome = require "downloads_chrome"
|
||||
downloads.default_dir = os.getenv("HOME") .. "/Downloads"
|
||||
|
||||
-- Add automatic PDF downloading and opening
|
||||
-- local viewpdf = require "viewpdf"
|
||||
local viewpdf = require "viewpdf"
|
||||
|
||||
-- Add vimperator-like link hinting & following
|
||||
local follow = require "follow"
|
||||
@@ -133,7 +133,7 @@ local cmdhist = require "cmdhist"
|
||||
local search = require "search"
|
||||
|
||||
-- Add ordering of new tabs
|
||||
local taborder = require "taborder"
|
||||
-- local taborder = require "taborder"
|
||||
|
||||
-- Save web history
|
||||
local history = require "history"
|
||||
@@ -156,7 +156,7 @@ local completion = require "completion"
|
||||
-- `,ts` to toggle scripts, `,tp` to toggle plugins, `,tr` to reset.
|
||||
-- If you use this module, don't use any site-specific `enable_scripts` or
|
||||
-- `enable_plugins` settings, as these will conflict.
|
||||
require "noscript"
|
||||
-- require "noscript"
|
||||
|
||||
local follow_selected = require "follow_selected"
|
||||
local go_input = require "go_input"
|
||||
@@ -172,22 +172,22 @@ local error_page = require "error_page"
|
||||
local styles = require "styles"
|
||||
follow.stylesheet = follow.stylesheet .. [===[
|
||||
#luakit_select_overlay .hint_label {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #f00;
|
||||
padding: 1px;
|
||||
color: #181818;
|
||||
font-size: 18px;
|
||||
opacity: 1;
|
||||
background-color: #f8f8f8 !important;
|
||||
border: 1px solid #f00 !important;
|
||||
padding: 1px !important;
|
||||
color: #181818 !important;
|
||||
font-size: 16px !important;
|
||||
opacity: 0.7 !important;
|
||||
}
|
||||
]===]
|
||||
|
||||
-- Hide scrollbars on all pages
|
||||
local hide_scrollbars = require "hide_scrollbars"
|
||||
-- local hide_scrollbars = require "hide_scrollbars"
|
||||
|
||||
-- local vertical_tabs = require "vertical_tabs"
|
||||
|
||||
-- Add a stylesheet when showing images
|
||||
local image_css = require "image_css"
|
||||
-- local image_css = require "image_css"
|
||||
|
||||
-- Add a new tab page
|
||||
local newtab_chrome = require "newtab_chrome"
|
||||
@@ -199,7 +199,7 @@ newtab_chrome.new_tab_src = [==[
|
||||
]==]
|
||||
|
||||
-- Add tab favicons mod
|
||||
-- local tab_favicons = require "tab_favicons"
|
||||
local tab_favicons = require "tab_favicons"
|
||||
-- local tab = require("lousy.widget.tab")
|
||||
-- tab.label_format = ""
|
||||
|
||||
@@ -207,7 +207,7 @@ newtab_chrome.new_tab_src = [==[
|
||||
-- tablist.min_width = 100
|
||||
|
||||
-- Add :view-source command
|
||||
local view_source = require "view_source"
|
||||
-- local view_source = require "view_source"
|
||||
|
||||
-- Use "asdfqwerzxcv" for generating labels
|
||||
local select = require "select"
|
||||
@@ -261,31 +261,31 @@ follow.pattern_maker = follow.pattern_styles.match_label
|
||||
-- end)
|
||||
|
||||
-- social media blocker
|
||||
local webview = require "webview"
|
||||
webview.add_signal('init', function (view)
|
||||
view:add_signal('navigation-request', function(v, uri)
|
||||
local blocklist_pattern = {
|
||||
"facebook.com",
|
||||
".fb.com",
|
||||
".fbcdn.com",
|
||||
".fbsbx.com",
|
||||
".fbcdn.net",
|
||||
".tfbnw.net",
|
||||
"whatsapp.com",
|
||||
"online-metrix.net",
|
||||
".fb.me",
|
||||
"facebook-web-clients.appspot.com",
|
||||
"fbcdn-profile-a.akamaihd.net"
|
||||
}
|
||||
for key,value in ipairs(blocklist_pattern)
|
||||
do
|
||||
if v.uri:match(value) then
|
||||
print("Navigation request to " .. v.uri .. " blocked.")
|
||||
return false
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
-- local webview = require "webview"
|
||||
-- webview.add_signal('init', function (view)
|
||||
-- view:add_signal('navigation-request', function(v, uri)
|
||||
-- local blocklist_pattern = {
|
||||
-- "facebook.com",
|
||||
-- ".fb.com",
|
||||
-- ".fbcdn.com",
|
||||
-- ".fbsbx.com",
|
||||
-- ".fbcdn.net",
|
||||
-- ".tfbnw.net",
|
||||
-- "whatsapp.com",
|
||||
-- "online-metrix.net",
|
||||
-- ".fb.me",
|
||||
-- "facebook-web-clients.appspot.com",
|
||||
-- "fbcdn-profile-a.akamaihd.net"
|
||||
-- }
|
||||
-- for key,value in ipairs(blocklist_pattern)
|
||||
-- do
|
||||
-- if v.uri:match(value) then
|
||||
-- print("Navigation request to " .. v.uri .. " blocked.")
|
||||
-- return false
|
||||
-- end
|
||||
-- end
|
||||
-- end)
|
||||
-- end)
|
||||
|
||||
-----------------------------
|
||||
-- End user script loading --
|
||||
|
||||
Reference in New Issue
Block a user