luakit-plugins
luakit-plugins copied to clipboard
Update ua switch
Uaswitch no longer loads (and prevents the browser from starting). This PR updates luakit-plugins/uaswitch
to use modes.add_cmds
, settings
rather than globals
and the new _M
style modules. (I'm assuming this is in line with #15, but that issue's light on details.)
A few things to pay extra attention to (I'm obviously happy to change anything):
- ua_strings.lua
returns its table rather than assigning it (as _M
can't be seen).
- A level of indirection is removed on startup: load()
which just called load_ua_strings()
is removed and load_ua_strings()
called directly.
- A level of indirection is removed with the default ua handling: ua_alias_default
is removed and "default"
used explicitly. (As there was no benefit to having a variable.)
I also have the (2017 era) list of UAs from #16 staged and ready to commit, if you'd like those included in this. (I assumed since there was a separate issue, a separate PR were appropriate).
I also have an enhancement to call a menu to display known UAs staged and ready to commit.