├── .gitignore
├── docs
├── options
│ ├── help
│ ├── remove
│ ├── version
│ └── list
├── releasenotes
│ ├── 2020.11.22.md
│ └── 0_next.md
├── readme_installation.md
└── description.md
├── options
├── func
├── ERR.sh
├── removefile.sh
└── addfiles.sh
├── LICENSE
├── vivaldi-autoinject-custom-js-ui
├── vivaldi-autoinject-custom-js-ui.1
├── README.md
├── config.mak
└── GNUmakefile
/.gitignore:
--------------------------------------------------------------------------------
1 | .cache/
2 | **/_*
3 |
--------------------------------------------------------------------------------
/docs/options/help:
--------------------------------------------------------------------------------
1 | Show help and exit
2 |
--------------------------------------------------------------------------------
/docs/options/remove:
--------------------------------------------------------------------------------
1 | Remove FILENAME
2 |
--------------------------------------------------------------------------------
/docs/options/version:
--------------------------------------------------------------------------------
1 | Show version and exit
2 |
--------------------------------------------------------------------------------
/docs/options/list:
--------------------------------------------------------------------------------
1 | Prints all installed js modifications
2 |
--------------------------------------------------------------------------------
/docs/releasenotes/2020.11.22.md:
--------------------------------------------------------------------------------
1 | #### 2020.11.22
2 |
3 | initial release
4 |
--------------------------------------------------------------------------------
/options:
--------------------------------------------------------------------------------
1 | [FILES ...]
2 | [--remove|-r FILENAME]
3 | --list|-l
4 | --help|-h
5 | --version|-v
6 |
--------------------------------------------------------------------------------
/func/ERR.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -E
4 | trap '[ "$?" -ne 98 ] || exit 98' ERR
5 |
6 | ERX() { >&2 echo "[ERROR] $*" ; exit 98 ;}
7 | # ERR() { >&2 echo "[WARNING] $*" ;}
8 | # ERM() { >&2 echo "$*" ;}
9 |
--------------------------------------------------------------------------------
/func/removefile.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | removefile() {
4 |
5 | local trg=${1##*/}
6 | local sharef="$_data_directory/$trg"
7 | local optf="$_vivaldi_directory/$trg"
8 | local str
9 |
10 | [[ -f $sharef ]] || ERX "file $sharef not found"
11 |
12 | rm -f "$sharef" "$optf"
13 |
14 | printf -v str '' "$trg"
15 |
16 | grep -v "$str" "$_browser_html" > "$_tmp"
17 | }
18 |
--------------------------------------------------------------------------------
/docs/releasenotes/0_next.md:
--------------------------------------------------------------------------------
1 | ### 2023.09.02
2 |
3 | The arch pacman hookfile is not part of this
4 | repository anymore, it is instead included in the AUR
5 | package. One major benefit with this is that Arch users
6 | installing from aur, will also have the hook removed
7 | if they uninstall the package. It also actually fixes
8 | an issue for everyone #1 .
9 |
10 | Vivaldi have changed the name of the file that we needed
11 | to modify, from browser.html -> window.html . A test
12 | checking the version of vivaldi is now performed
13 | to correctly predict the name of the file to be modified.
14 |
15 | This release is also a rewrite and reorganisation of the
16 | code, previously development happened on the "dev" branch
17 | and required a not available build system. Now the "next" branch,
18 | which is also the default, is where development happens,
19 | and "master" is on the commit where releases happens.
20 |
21 | Thanks to @pncolvr and @coordinatio for helping out with this
22 | release!
23 |
--------------------------------------------------------------------------------
/func/addfiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | addfiles() {
4 |
5 | declare -a files
6 |
7 | # make sure all files to add have .js suffix
8 | for f in "$@" "$_data_directory"/*.js ; do
9 | [[ -f $f && $f =~ [.]js$ ]] && files+=("$f")
10 | done
11 |
12 | ((${#files[@]})) || ERX \
13 | "could not find any js files to inject." \
14 | "add files to $_data_directory" \
15 | "or as arguments to this command"
16 |
17 | mkdir -p "$_data_directory"
18 |
19 | for f in "${files[@]}"; do
20 | printf -v str '' "${f##*/}"
21 | cp -f "$f" "$_browser_html"
22 |
23 | # files passed as arguments overwrites existing
24 | # files in /usr/share/vivaldi-UI-js
25 | [[ $f = "$_data_directory/${f##*/}" ]] \
26 | || cp -f "$f" "$_data_directory"
27 |
28 | # adds entry in browser.html if it doesn't exist
29 | grep "$str" "$_tmp" >/dev/null \
30 | || sed -ri "s|([[:space:]]*)(