Skip to content

Commit

Permalink
Merge pull request #159 from Jay-o-Way/docs-brush-up
Browse files Browse the repository at this point in the history
Docs brush up
  • Loading branch information
U-C-S authored Sep 11, 2024
2 parents 41b4402 + 766a310 commit 0b38373
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 99 deletions.
72 changes: 40 additions & 32 deletions Docs/Edit-UserSettingsjson.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
When Hurl is lauched for the first time, it automatically detects the installed browsers in the computer and Creates a UserSettings.json file at `C:\Users\{USER}\AppData\Roaming\Hurl` filling it with browsers it detected. A typical UserSettings.json file looks like this.
# User settings

When Hurl is lauched for the first time, it automatically detects the installed browsers and creates a _UserSettings.json_ file at `C:\Users\{USER}\AppData\Roaming\Hurl` filling it with browsers it detected. A typical UserSettings.json file looks like this:

```json
{
Expand Down Expand Up @@ -29,46 +31,52 @@ When Hurl is lauched for the first time, it automatically detects the installed
}
```

## App Settings
## App settings

The following snippet shows the default options:

The following snippet does this shows the default options
```json
"AppSettings": {
"LaunchUnderMouse": false,
"RuleMatching": false,
"NoWhiteBorder": false,
"BackgroundType": "mica",
"WindowSize": [420,210]
"LaunchUnderMouse": false,
"MinimizeOnFocusLoss": true,
"NoWhiteBorder": false,
"BackgroundType": "mica",
"RuleMatching": false,
"WindowSize": [460,210]
}
```

### Available Options
- `LaunchUnderMouse` defaulted to false, can be used to launch the hurl window under the mouse when enabled
- `NoWhiteBorder` set true or false to enable or disable the white border around the window.
- `BackgroundType` supports `mica`, `acrylic`, `none`
- win11 22H2 or above supports all options
- win11 build 22000 only mica
- win10 is defaulted to `none` irrespective of option
- `WindowSize` is to set the size of Hurl BrowserSelect window. You dont need to set this, Just resize the window accordingly, It get filled automatically.
- `RuleMatching` defaulted to false, on enabling, it supports the features from [Rulesets](https://github.com/U-C-S/Hurl/wiki/Rulesets)

## Browsers Field

- `Name` - you know (Req.)
- `ExePath` - The path of browser main exe file (Req.)
- `CustomIconPath` - Use absolute path of the image. Also, Supports URLs (OPTIONAL)
- `LaunchArgs` - Add the default exe launch arguments here. use param `%URL%` injecting the Url at runtime here (OPTIONAL)
- `Hidden` - set it to `true` to hide the current icon in the selection screen (OPTIONAL)
- `AlternateLaunches` - This is an array .... see below (OPTIONAL)
### Available options

- `LaunchUnderMouse` default is **false**, can be used to launch the Hurl window under the mouse when enabled
- `MinimizeOnFocusLoss` default is **true**
- `NoWhiteBorder` set **true** or **false** to enable or disable the white border around the window
- `BackgroundType` supports **mica**, **acrylic**, **none**
- Windows 11 22H2 or above supports all options
- Windows 11 build 22000 supports only mica
- Windows 10 default is **none** irrespective of option
- `RuleMatching` default is **false**. On enabling, it supports the features from [Rulesets](https://github.com/U-C-S/Hurl/wiki/Rulesets)
- `WindowSize` is to store the size of Hurl BrowserSelect window. You dont need to set this, it will be saved automatically when the window is resized.

## Browsers

- `Name` - Displayed name for browser. Required.
- `ExePath` - The path of browser main exe file. Required.
- `CustomIconPath` - The absolute path of the image. Supports URLs. Optional.
- `LaunchArgs` - Add the default exe launch arguments here. Use param `%URL%` injecting the URL at runtime here. Optional.
- `Hidden` - set it to **true** to hide the current icon in the selection screen. Optional.
- `AlternateLaunches` - This is an array; See below. Optional.

### AlternateLaunches
This is a way to launch the browser when you have multiple launch methods or launch targets... like incognito, browser profiles...

Suppose you have multiple chrome profiles like this
This is a way to launch the browser when you have multiple launch methods or launch targets, like incognito, browser profiles...

Suppose you have multiple chrome profiles like this:

![image](https://user-images.githubusercontent.com/50218121/158058450-21eda36a-9794-4f34-97c7-ae5c5f105412.png)
![Example of Chrome profile in .lnk shortcut](./Images/ChromeProfiles.png)

Then you might wanna use this feature, instead of totally adding a new browser entity for each profile in settings file. The following snippet demonstrates this feature. Adding the `AlternateLaunches` field to browser entity will you simply right-click on the browser icon in the selection window and choose the req. option.
Then you might want to use this feature, instead of totally adding a new browser entity for each profile in the settings file. The following snippet demonstrates this feature.
Adding the `AlternateLaunches` field to the browser entity allows you to simply right-click on the browser icon in the selection window and choose the required option.

```json
"AlternateLaunches": [
Expand All @@ -87,9 +95,9 @@ Then you might wanna use this feature, instead of totally adding a new browser e
]
```

Right-Clicking on the browser that has `AlternateLauches` brings up the context menu with options specified as in the settings file. On selecting the the URL will also automatically included while launching the browser.
Right-clicking on the browser that has `AlternateLauches` brings up the context menu with options specified as in the settings file. On selecting the the URL will be automatically included while launching the browser.

![image](https://user-images.githubusercontent.com/50218121/172186598-9414b860-ecaf-4bb4-bc69-a49c6cfedfdb.png)
![MainWindow with profile options on BrowserButtton](./Images/BrowserProfiles.png)

- `ItemName` - The name that shows up in the context menu for this launch
- `LaunchArgs` - Launch args. You can keep launch the browser in incognito, other browser profiles...
72 changes: 39 additions & 33 deletions Docs/Features/Rule-Matching.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
## About
### What are Rules ?
They are text strings, which when configured can automatically open a browser for you, instead of prompting for selecting a browser.. Thus saving a extra step. Each time, you open a link in Hurl, It goes through all the configured rules to see if any matches with link and if it matches, It automatically opens the associated Browser.
# Using rules to speeds things up

### What about Rulesets ?
Each Ruleset is a collection of rules. You can have as many rules as you want inside a Ruleset. Each Ruleset is associated to a Browser and You can have multiple rulesets for same browser. Additionally, Rulesets prioritized as per the ordering. If same rule exists in two different rulesets, the ruleset that's higher in the list is triggered first.
## What are rules?

They are text strings, which when configured can automatically open a browser for you, instead of prompting to select a browser. Thus saving a step. Each time you open a link via Hurl, it searches through all the configured rules to see if any matches with the URL and if it matches, it automatically opens the associated browser.

### Types of rules

## Types of Rules
- `String`: This does simple text matching. Triggers if your URL matches exactly with this plain rule.
- `Domain`: Simply the domain part of a URL, ex: For the URL `https://github.com/u-c-s/hurl`, `github.com` is the domain. Probably the most useful rule type.
- `Regex`: Uses Regular Expressions to do text matching. Use https://regex101.com with (.NET/C# flavor) to test your rules.
- `Glob`: (Prefer using `Domain` rule over this, possibly could get breaking changes or removed completely in future versions) Uses Glob Pattern matching. Use https://www.digitalocean.com/community/tools/glob to test your rules
- `Domain`: Simply the domain part of a URL, example: For the URL `https://github.com/u-c-s/hurl`, `github.com` is the domain. Probably the most useful rule type.
- `Regex`: Uses Regular Expressions to do text matching. Use <https://regex101.com> with (.NET/C# flavor) to test your rules.
- `Glob`: (Prefer using `Domain` rule over this, possibly could get breaking changes or removed completely in future versions) Uses Glob Pattern matching. Use [this website](https://www.digitalocean.com/community/tools/glob) to test your rules.

> [!NOTE]
> URLs typically have the `https://` prefix which also needs to be taken care by the rules you have written.
## What about rulesets?

> Note that URLs typically have `https://` prefix which also need to be taken care by the rules you have written.
Each ruleset is a collection of rules. You can have as many rules as you want inside a ruleset. Each ruleset is associated to a browser and you can have multiple rulesets for the same browser. Additionally, rulesets are prioritized as per the ordering. If the same rule exists in two different rulesets, the ruleset that's higher in the list is triggered first.

## From UI

Adding new rule can be done from UI by clicking `+ Rules` button in the Hurl main window.
Adding a new rule can be done from UI by selecting **Rules** in the Hurl main window.

- Use `Create` option to create a new Ruleset
- Choose the Browser and the available Alternate Launches
- Add any number of Rules with any rule type by selecting a rule type and entering the rule for each.
- Save!
- Use `Test` to the newly added rules
- Select **Create** to create a new ruleset
- Choose the browser and the available Alternate Launches
- Add any number of rules with any rule type by selecting a rule type and entering the rule for each
- Save
- Select **Test** to the newly added rules
- Enter the URL you want to test the rules with.
- `Test against Existing Rules` will test URL with above added rules.
- `Test with Rule` option can test against the specific rule you entered here.
- Note that, you can rearrange Rulesets ordering from the UI, but not the rules in the ruleset itself.

- **Test against existing rules** will test URL with above added rules.
- **Test with rule** will test against the specific rule you entered here.
- Note that you can rearrange rulesets ordering from the UI, but not the rules in the ruleset itself.

## From UserSettings.json

You can add new rules into `AutoRoutingRules` property, which itself is a list of Rules Objects. Each rule object should contain 2 properties
- `Rules` : it can be a single rule or multiple rules. (rules are prioritiesed, so first rule that matches will trigger the opening of browser)
- `BrowserName`: The value should be a Browser name that matches one of the `Browsers` names. which will be opened once a rule from the `Rules` property matches. Use `_Hurl` value to open Hurl
- `Name` To name the ruleset. Only for visual purposes. does not have any functionality.
- `AltLaunchIndex` to select the Alt Launch for a browser. It's a index number.
You can add new rules into `AutoRoutingRules` property, which itself is a list of Rules Objects. Each rule object should contain 2 properties:

- `Rules`: It can be a single rule or multiple rules. Rules are prioritized: the first rule that matches will trigger the opening of a browser.
- `BrowserName`: The value should be a Browser name that matches one of the `Browsers` names. It will be opened once a rule from the `Rules` property matches. Use `_Hurl` to open Hurl.
- `Name`: To name the ruleset. Only for visual purposes.
- `AltLaunchIndex` to select the Alt Launch for a browser. It's an index number.

Sample Json file for more advanced editing:

Sample Json file for more advanced editing....
```json
{
"Browsers": [
Expand All @@ -63,11 +69,11 @@ Sample Json file for more advanced editing....
}
```

Note that when adding Rules to UserSettings.json directly, follow the below pattern.
Note that when adding rules to _UserSettings.json_ directly, follow the below pattern:

| Rule Type | Format | Example |
| --- | --- | --- |
| String | `s$__your_rule__` or `__your_rule__` | `https://github.com/U-C-S` |
| Domain | `d$__your_rule__` | `d$github.com` |
| Regex | `r$__your_rule__` | `r$.*open\\.spotify\\.com.*` |
| Glob | `g$__your_rule__` | `g$*.google.com*` |
| Rule type | Format | Example |
| --- | --- | --- |
| String | `s$<YourRule>` or `<YourRule>` | `https://github.com/U-C-S` |
| Domain | `d$<YourRule>` | `d$github.com` |
| Regex | `r$<YourRule>` | `r$.*open\\.spotify\\.com.*` |
| Glob | `g$<YourRule>` | `g$*.google.com*` |
Binary file added Docs/Images/BrowserProfiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/Images/ChromeProfiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/Images/HurlMainWindow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions Extensions/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Hurl Extension
# Hurl browser extension

This browser extension uses Native Messaging API to communicate with the Hurl Application.

## Installation

To use it in Chrome, follow the steps below:

- Enable the Developer Mode for Extensions in Chrome
- Choose the folder `{installationDir}/Extensions/Chrome` after clicking `Load Unpacked` Button available after enabling Developer mode
- Enable the Developer Mode for Extensions in Chrome ([instructions on Chromium blog](https://blog.chromium.org/2009/06/developer-tools-for-google-chrome.html))
- Select **Load Unpacked**
- Choose the folder `{installationDir}/Extensions/Chrome`

Run the `install-nmh.ps1` script as admin located in `{installationDir}/Extensions` after installing the extension. Also Get the extension id from the extension page in Chrome.
Run the `install-nmh.ps1` script as admin located in `{installationDir}/Extensions` after installing the extension. Also get the extension id from the extension page in Chrome.

```powershell
cd {installationDir}
Expand All @@ -18,4 +19,4 @@ cd {installationDir}

You can modify the script to use it for other chromium-based browsers by editing the REG command in it and pointing to appropriate browser's registry key for Native Messaging Hosts.

During **Development**, Use the `dir_where_Launcher.exe_is` to point to the directory where the `Launcher.exe` is located (usually to `Source/Launcher/target/debug`).
During **Development**, use the `dir_where_Launcher.exe_is` to point to the directory where the _Launcher.exe_ is located (usually to `Source/Launcher/target/debug`).
57 changes: 28 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<img width="150" align="left" src="Source/Hurl.BrowserSelector/Assets/internet.ico">
# Hurl

<h1 align="center">Hurl</h1>
A Windows utility that lets you choose a browser on the click of a link.

<p align="center">A windows utility that lets you choose a browser on the click of a link</p>
![Hurl Icon](Source/Hurl.BrowserSelector/Assets/internet.ico)

<p align="center">
<a style="text-decoration:none" href="https://github.com/U-C-S/Hurl/releases">
Expand All @@ -19,59 +19,58 @@
</a>
</p>

> [!NOTE]
> This software is currently in pre-v1.0 version, which means it can frequently introduce breaking changes with new versions.
## Why and What?
## Why and what?

Sometimes you might want to open a link in a browser of your choice, instead of the default one. Hurl can let you choose the browser eachtime you click a link (links outside of browser). So naturally, It acts as default browser to do that. And hurl can be powered up with a _browser extension_ to let you open a browser tab in different browser.
Sometimes you might want to open a link in a browser of your choice, instead of the default one. Hurl lets you choose the browser each time you click a link (links outside of browsers). So naturally, it acts as default browser to do that.
Hurl can be powered up with a _browser extension_ to let you open a browser tab in a different browser.

- Modern Windows UI with Multiple Customization Options
- Supports adding own browser config with Launch Arguments
- Modern Windows UI with multiple customization options
- Supports adding own browser configuration with Launch Arguments
- Rules to automatically open a browser without prompting
- Settings application to manage all the features (beta)
- Web Extension to open browser tabs in Hurl (experimental)

<p align="center">
<img width="720" src="https://github.com/user-attachments/assets/dc4cc718-abf8-4032-9ef9-df832a1d059b" />
<!--<img width="720" src="" />-->
<!--https://github.com/user-attachments/assets/7b3418fb-38e1-4259-85c6-11603c6eec7d-->
<!--<img width="720" src="https://user-images.githubusercontent.com/50218121/230982396-152a2342-f02a-47c0-9349-3d1a4920554f.png" />-->
<!--<img width="720" src="https://user-images.githubusercontent.com/50218121/198988257-7f89288c-7fd4-4bf3-8d7f-b5501d81ac61.png" />-->
<!--<img width="640" src="https://user-images.githubusercontent.com/50218121/158625754-78026dbe-cd99-4078-8407-313b9c548ca1.png" />-->
<!--<img width="640" src="https://user-images.githubusercontent.com/50218121/157494232-a134a412-9dd7-4706-8be7-6e3800484082.png" />-->
</p>
![MainWindow](Docs/Images/HurlMainwindow.png)

> As a Web-Developer, Web-Surfer and someone who uses 3 browsers, Hurl is a bliss
~ Me, probably

> As a Web-Developer, Web-Surfer and someone who uses 3 browsers, Hurl is a bliss - Me probably
## Installation and usage

## Installation & Usage
Download and install the latest versions of:

Download and Install the latest versions of
- [.NET 8 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/8.0)
- Windows App Runtime v1.5 [Direct Download Link](https://aka.ms/windowsappsdk/1.5/latest/windowsappruntimeinstall-x64.exe)
- [Hurl_Installer](https://github.com/U-C-S/Hurl/releases/latest)

Get the Hurl_Installer from [Releases](https://github.com/U-C-S/Hurl/releases/latest) and Install it.
> [!TIP]
> It is recommended to uninstall your current version before installing a new version.
Lastly, After installing, Make sure to set Hurl as the default `http/https` protocol handler in the Windows Settings ( For Windows 11, `Settings > Apps > Defualt apps > Hurl`), just like how you change the default browser.
After installing, make sure to set Hurl as the default `http/https` protocol handler in the Windows Settings. In Windows 11: **Settings** > **Apps** > **Default apps** > **Hurl** > **Set as standard browser**.

> Check out [Hurl Wiki](https://github.com/U-C-S/Hurl/wiki/) for more details on usage and configuration. And [Extensions/README.md](./Extensions/README.md) for installing the Browser Extension.
Go to [Hurl Wiki](https://github.com/U-C-S/Hurl/wiki/) for more details on usage and configuration. See [Extensions readme](./Extensions/README.md) for installing the Browser Extension.

## Building from Source / Local Development
## Building from source / local development

- Install Visual Studio 2022 with following workloads
- Install [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with following workloads:
- .NET desktop development
- Windows application development
- Desktop development with C++ (required for building Launcher)
- After Cloning the Repo, Open the solution file `./Hurl.sln` in Visual Studio. You can change the projects between Hurl.BrowserSelector and Hurl.Settings
- After forking and cloning the repository, open the solution file `./Hurl.sln` in Visual Studio. You can change the projects between _Hurl.BrowserSelector_ and _Hurl.Settings_
- Install [Rustup / Setup Rust complier](https://www.rust-lang.org/tools/install) locally to debug Launcher app
- Install Inno Setup, to create the Hurl Installer
- Install [Inno Setup](https://jrsoftware.org/isdl.php) to create the Hurl Installer

Use the Build Script from `Utils/build.ps1` to build the Application in release mode and successively build the installer. Make sure you have all the tools installed mentioned in the above description.
Use the Build Script from `Utils/build.ps1` to build the application in _Release_ mode and build the installer. Make sure you have all the tools installed mentioned in the above description.

To check out older versions source code, Use the [Github Tags](https://github.com/U-C-S/Hurl/tags).
To check out older versions source code, go to [Github Tags](https://github.com/U-C-S/Hurl/tags).

## Contributing

The Project is open to Pull-Requests and Feedback. MIT License.
The project is open to Pull-Requests and Feedback. MIT License.

## Credits

Expand Down

0 comments on commit 0b38373

Please sign in to comment.