User manual (browser extension) » History » Version 22
koszko, 03/12/2022 08:50 PM
update "Operating the popup window" part for Haketilo 1.0
1 | 1 | koszko | # User manual |
---|---|---|---|
2 | |||
3 | 5 | jahoti | {{toc}} |
4 | |||
5 | 1 | koszko | ## Installation |
6 | |||
7 | 21 | koszko | Instructions for different browsers have been put on their respective pages: |
8 | 1 | koszko | * [[Installation instructions (Mozilla)]] |
9 | * [[Installation instructions (Chromium)]] |
||
10 | |||
11 | 12 | jahoti | Users who want to install Haketilo from source can also visit [[Building the extension]] page. |
12 | 1 | koszko | |
13 | ## Understanding the concepts |
||
14 | |||
15 | 21 | koszko | ### Script blocking and injection |
16 | Haketilo combines features of a user script manager and a content blocker. Out of the box, it can be used to block site's JavaScript, similarly to how NoScript (for example) does it. Once you import custom scripts into Haketilo (either from a Hydrilla repository server or by typing code in a form in the settings page), it can also inject them into pages. |
||
17 | |||
18 | Script blocking and injection is configured using [[URL patterns]]. Patterns have different specificity. More specific patterns will override the settings of the less specific ones. In short, for every visited page, Haketilo performs the following steps: |
||
19 | 1. Check if the page is privileged (e.g. it is its own settings page or a directory listing of local filesystem). If it is, don't attempt to block nor inject anything on this page and don't perform the remaining steps. |
||
20 | 2. Try to find a script blocking/allowing/injection rule with a pattern matching page's URL. If found, apply the rule and don't perform the next step. |
||
21 | * If multiple rules match, pick the one with the most specific pattern. |
||
22 | 3. Check whether the default policy is to block scripts or allow them. Act accordingly. |
||
23 | |||
24 | In the end, Haketilo's action shall be one of the following: |
||
25 | * block page's own scripts |
||
26 | * allow page's own scripts to execute (i.e. don't do anything) |
||
27 | * inject the supplied user script **and** block page's own scripts |
||
28 | |||
29 | We can see that Haketilo's concepts are different from those of most user script managers. GreaseMonkey, for instance, executes user scripts alongside page's original scripts. Haketilo effectively **replaces** page's scripts with the user-supplied ones. |
||
30 | |||
31 | ### Mappings and Resources |
||
32 | |||
33 | To make handling JavaScript libraries more manageable, we introduced our own concept of packages. Currently, Haketilo understands 2 different types of items (i.e. packages): |
||
34 | * Resource - It defines a set of scripts that can be injected together into a page. It can also name other resources as its dependencies. When injecting scripts of a given resource into some page, Haketilo will first inject scripts of all resources depended on. |
||
35 | * Mapping - It associates URL patterns with resources in a 1:1 fashion. If pattern `https://example.com/***` is associated with resource `my-sample-res` it means the scripts from `my-sample-res` should be injected into all HTTPS pages under the example.com domain. |
||
36 | |||
37 | For simple cases, this may be overly complex. Because of that, Haketilo's settings page contains a simple form that can be used to quickly define a script payload for a set of URL patterns. |
||
38 | |||
39 | Mappings and resources can also be installed from Hydrilla repository which serves both simple and complex (i.e. multi-resource) payloads. Defining more complex mappings and resources within Haketilo itself is not (yet) supported. |
||
40 | |||
41 | 20 | koszko | ## Operating the popup window |
42 | 1 | koszko | |
43 | 22 | koszko | While browsing with Haketilo installed, a small Haketilo icon will be present in the extensions panel (usually located to the right of the url bar). Clicking on it will open the extension's popup. |
44 | 21 | koszko | |
45 | 22 | koszko | ![Haketilo popup with an arrow pointing at the Haketilo icon used to open it](haketilo_popup.png) |
46 | 1 | koszko | |
47 | 22 | koszko | At the very bottom of the popup there is a convenience shortcut - a button which, when clicked, opens Haketilo's [[#Using-the-settings|settings page]]. At the top is page's status report, containing information on how Haketilo has modified the currently viewed page. For the above website there is no custom policy set. As a result Haketilo simply applies the default policy of blocking scripts. In cases a policy is set for a matching [[URL patterns|URL pattern]], it is used to modify the page and its details can be viewed in the popup. |
48 | 5 | jahoti | |
49 | 22 | koszko | ![Haketilo popup on opencores.org with a payload injected](haketilo_popup_payload.png) |
50 | 5 | jahoti | |
51 | 22 | koszko | Sometimes you might wish to look for custom scripts to use on sites or for ethical fixes others made to enable browsing without running nonfree JavaScript sites serve. Such search can be performed from the popup. Clicking the "Search for custom resources" button below status report will bring up the repository query view. |
52 | 5 | jahoti | |
53 | 22 | koszko | ![Haketilo popup with "Search for custom resources" button highlighted](haketilo_popup_search_for_custom.png) |
54 | 5 | jahoti | |
55 | 22 | koszko | Repository view contains a list of all installed repositories. Each entry has a "Show results" button which, when clicked, will make Haketilo query the repository for payloads that can be used on the viewed website. Haketilo comes with `https://hydrilla.koszko.org/api_v1/` configured as the default repository to use. This can of course be changed in the settings page. |
56 | 5 | jahoti | |
57 | 22 | koszko | ![Haketilo popup with "Show results" button highlighted](haketilo_popup_show_results.png) |
58 | 12 | jahoti | |
59 | 22 | koszko | Currently, there are very few custom scripts listed in the main Hydrilla instance; if you are lucky enough to find a match, however, click the "More..." button on the right to install the policy. |
60 | 15 | jahoti | |
61 | 22 | koszko | ![Haketilo popup with "More..." button pointed to by an arrow](haketilo_popup_more.png) |
62 | 6 | koszko | |
63 | 22 | koszko | In the view that appears you can see the components of the policy you want to install. If, by chance, some components are already installed (for example because they were required by some other policy you installed earlier), they won't be listed. There is an exception - components with a newer version available. Those will be listed and proceeding with the installation will cause them to be updated. |
64 | 12 | jahoti | |
65 | 22 | koszko | When you're sure you want to commit the installation, just click "Install". |
66 | 15 | jahoti | |
67 | 22 | koszko | ![Haketilo popup with "Install" button highlighted](haketilo_popup_install.png) |
68 | 11 | jahoti | |
69 | 22 | koszko | Voilà! The installed items (mapping and resource(s)) will be used the next time you load a matching page. They can also be viewed and managed under the appropriate tabs on the [[#Using-the-settings|settings page]]. |
70 | 12 | jahoti | |
71 | 22 | koszko | Above all else, Haketilo is designed to put you in control of your web browsing. Like Haketilo itself, all scripts distributed as defaults with the extension and published in the Hydrilla repository are free software. This means you can read, modify and distribute them without undue restrictions in either compiled form or as source code. |
72 | 1 | koszko | |
73 | |||
74 | 15 | jahoti | ## Manually importing custom scripts |
75 | 8 | koszko | |
76 | 21 | koszko | **Note: this section of the manual corresponds to old Haketilo version 0.1 and is awaiting an update** |
77 | |||
78 | 8 | koszko | Although installation of site fixes and custom content is meant to be convenient through the use of a repository, one can also export and import such payloads to and from JSON files. In fact, all the scripts currently served by the default Hydrilla repository can be downloaded in that format from https://hachette-hydrilla.org/. Most are fixes for js-encumbered websites, but there are also some alternative interfaces for already-functional sites. You can download and install particular scripts one by one or go crazy and just import it all at once from the "All-in-one bundle". |
79 | |||
80 | 12 | jahoti | After you've downloaded the right .json file, go to Haketilo's settings page (reachable by clicking the button at the bottom of the popup window) and click "Import". |
81 | 8 | koszko | |
82 | 15 | jahoti | ![Haketilo settings page with import button](hachette_settings_import_but.png) |
83 | 8 | koszko | |
84 | Now, find and choose the .json file with scripts. |
||
85 | |||
86 | 14 | jahoti | ![selecting bundle.json in file chooser](navigate_scripts_bundle.png) |
87 | 8 | koszko | |
88 | 12 | jahoti | In the frame that appears you can select which components you want to install. Note that components might behave improperly if you disable other ones they depend on. As of version 0.1, Haketilo will do nothing to stop you from messing things up ;) |
89 | 1 | koszko | |
90 | 14 | jahoti | ![selecting which components to import from .json file](hachette_settings_import_frame.png) |
91 | 1 | koszko | |
92 | If you click "Ok", scripts and settings are imported. Voilà! They can be viewed and managed under the appropriate tabs on the [[#Using-the-settings|settings page]]. |
||
93 | |||
94 | 11 | jahoti | ## Using the settings |
95 | 10 | jahoti | |
96 | 21 | koszko | **Note: this section of the manual corresponds to old Haketilo version 0.1 and is awaiting an update** |
97 | |||
98 | 16 | jahoti | As well as allowing you to [[#Manually-importing-custom-scripts|manually import scripts from JSON files]], the settings page provides access to all configurable options available in Haketilo. These are arranged under four tabs, one for each type of item- repository, page (pattern), bag, and script. |
99 | 1 | koszko | |
100 | 16 | jahoti | ![the bags tab in the Haketilo settings](haketilo_bags_tab.png) |
101 | |||
102 | Each tab is arranged similarly, with a list of items followed by an "Add ..." button (which opens an empty new item for editing). Besides every item is an edit button, a remove button, and- except for on repositories- an export button, which exports the item and its dependencies to JSON format for download. |
||
103 | |||
104 | Editing an item will open up a form with appropriate fields. **Changes are not autosaved**; they must be manually committed using the "save" button at the bottom of each form. |
||
105 | |||
106 | ![an edit form, in this case for a repository](haketilo_repo_edit.png) |
||
107 | |||
108 | Repositories and scripts currently employ relatively simple forms. However, to allow ample space for editing the source code of scripts, the form overflows the page, |
||
109 | which requires scrolling down to find the "save" button and avoid losing changes. |
||
110 | |||
111 | ![an edit form for a script, too large to fit on one page](haketilo_script_edit.png) |
||
112 | |||
113 | Bags can contain scripts and other bags, and opening one to edit it will present alongside the name a list of items contained within. To add new items, click on the "Add scripts" button towards the bottom of the form, select which new items, and click "Ok". |
||
114 | |||
115 | ![the edit form for a bag](haketilo_bag_edit.png) |
||
116 | |||
117 | ![the item selection popup for a bag](haketilo_bag_popup.png) |
||
118 | |||
119 | 18 | jahoti | Editing a page is slightly different to other items, even if the form works the same way. Instead of a name, pages have a field for a [[URL patterns|URL pattern]] that they apply to and a field for a payload to inject into them. This payload can be changed by clicking on the "Choose payload" button, which will bring up a popup similar to the one for bags except that only one item is selected at a time. Injecting a payload **will block all scripts that are sent with a page natively**. |
120 | 16 | jahoti | |
121 | ![the edit form for a page](haketilo_page_edit.png) |
||
122 | |||
123 | ![choosing a payload for a page](haketilo_page_popup.png) |
||
124 | |||
125 | As well as a list of all available scripts and bags, at the very bottom of the payloads popup there is the option "(None)" for no payload. When selected, this enables an additional checkbox in the editing form, which controls whether or not a the scripts sent with a page natively should be blocked. Script-blocking behavior on URLs without a corresponding page policy listed can also be set, at any time, using the "Toggle policy" button at the bottom of the pages tab. |
||
126 | 1 | koszko | |
127 | ![controlling script-blocking behavior in the pages tab](haketilo_edit_script_blocking.png) |
||
128 | 16 | jahoti | |
129 | ## What to do next |
||
130 | 21 | koszko | |
131 | Please [[Reporting bugs|REPORT BUGS]]. This is incredibly important. If nobody reports them, they likely won't get fixed. |
||
132 | 8 | koszko | |
133 | 14 | jahoti | You might want to learn about [[Known limitations|current limitations]] of Haketilo. If despite these you like the extension, please spread the word. We'll be also happy to receive some feedback or - if you're a programmer - code contributions. Consider [creating an account](/account/register) on our issue tracker or writing to koszko@koszko.org :) |