Skip to content

Commit a4a684f

Browse files
authored
Merge pull request #64 from n4ze3m/next
v1.1.7
2 parents b982ce1 + 8f8fac8 commit a4a684f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+782
-242
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,7 @@ keys.json
4242

4343
# typescript
4444
.tsbuildinfo
45-
.wxt
45+
# WXT
46+
.wxt
47+
# WebStorm
48+
.idea

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ Note: You can install the extension on any Chromium-based browser. It is not lim
3030

3131
### Manual Installation
3232

33+
#### Pre-requisites
34+
35+
- Node.js (v18 or higher) - [Installation Guide](https://nodejs.org)
36+
- npm
37+
- Ollama (Local AI Provider) - [Installation Guide](https://ollama.com)
38+
39+
3340
1. Clone the repository
3441

3542
```bash
@@ -43,20 +50,33 @@ cd page-assist
4350
npm install
4451
```
4552

46-
3. Build the extension
53+
3. Build the extension (by default it will build for Chrome)
4754

4855
```bash
4956
npm run build
5057
```
5158

52-
4. Load the extension
59+
or you can build for Firefox
60+
61+
```bash
62+
npm run build:firefox
63+
```
64+
65+
4. Load the extension (chrome)
5366

5467
- Open the Extension Management page by navigating to `chrome://extensions`.
5568

5669
- Enable Developer Mode by clicking the toggle switch next to Developer mode.
5770

5871
- Click the `Load unpacked` button and select the `build` directory.
5972

73+
5. Load the extension (firefox)
74+
75+
- Open the Add-ons page by navigating to `about:addons`.
76+
- Click the `Extensions` tab.
77+
- Click the `Manage Your Extensions` button.
78+
- Click the `Load Temporary Add-on` button and select the `manifest.json` file from the `build` directory.
79+
6080
## Usage
6181

6282
### Sidebar
@@ -89,18 +109,18 @@ This will start a development server and watch for changes in the source files.
89109
| -------- | ------- | ----------------- | ------ |
90110
| Chrome ||||
91111
| Brave ||||
112+
| Firefox ||||
92113
| Edge ||||
93114
| Opera GX ||||
94115
| Arc ||||
95-
| Firefox ||||
96116

97117
## Local AI Provider
98118

99119
- [Ollama](https://github.com/ollama/ollama) (Currently the only supported provider. More providers will be added in the future.)
100120

101121
## Roadmap
102122

103-
- [ ] Firefox Support
123+
- [X] Firefox Support
104124
- [ ] More Local AI Providers
105125
- [ ] More Features
106126
- [ ] More Customization Options

bun.lockb

472 Bytes
Binary file not shown.

docs/connection-issue.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Ollama Connection Issues
2+
3+
Connection issues can be caused by a number of reasons. Here are some common issues and how to resolve them on Page Assist. You will see the following error message if there is a connection issue:
4+
5+
### 1. Direct Connection Error
6+
![Direct connection error](https://image.pageassist.xyz/Screenshot%202024-05-13%20001742.png)
7+
8+
### 2. `403` Error When Sending a Message
9+
![403 error when sending a message](https://image.pageassist.xyz/Screenshot%202024-05-13%20001940.png)
10+
11+
This issue usually occurs when Ollama is not running on [http://127.0.0.1:11434/](http://127.0.0.1:11434/), and the connection is from the private network or a different network.
12+
13+
### Solutions
14+
15+
Since Ollama has connection issues when directly accessed from the browser extension, Page Assist rewrites the request headers to make it work. However, automatic rewriting of headers only works on `http://127.0.0.1:*` and `http://localhost:*` URLs. To resolve the connection issue, you can try the following solutions:
16+
17+
1. Go to Page Assist and click on the `Settings` icon.
18+
19+
2. Click on the `Ollama Settings` tab.
20+
21+
3. There you will see the `Advance Ollama URL Configuration` option. You need to expand it.
22+
23+
![Advance Ollama URL Configuration](https://image.pageassist.xyz/Screenshot%202024-05-13%20003123.png)
24+
25+
4. Enable the `Enable or Disable Custom Origin URL` option.
26+
27+
![Enable or Disable Custom Origin URL](https://image.pageassist.xyz/Screenshot%202024-05-13%20003225.png)
28+
29+
5. (Optional) If Ollama is running on a different port or host, then change the URL in the `Custom Origin URL` field; otherwise, leave it as it is.
30+
31+
This will resolve the connection issue, and you will be able to use Ollama without any issues on Page Assist ❤
32+
33+
If you still face any issues, feel free to contact us [here](https://github.com/n4ze3m/page-assist/issues/new), and we will be happy to help you out.

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"description": "Use your locally running AI models to assist you in your web browsing.",
66
"author": "n4ze3m",
77
"scripts": {
8-
"dev": "wxt",
9-
"dev:firefox": "wxt -b firefox",
10-
"build": "wxt build",
11-
"build:firefox": "wxt build -b firefox",
12-
"zip": "wxt zip",
13-
"zip:firefox": "wxt zip -b firefox",
8+
"dev": "cross-env TARGET=chrome wxt",
9+
"dev:firefox": "cross-env TARGET=firefox wxt -b firefox",
10+
"build": "cross-env TARGET=chrome wxt build",
11+
"build:firefox": "cross-env TARGET=chrome cross-env TARGET=firefox wxt build -b firefox",
12+
"zip": "cross-env TARGET=chrome wxt zip",
13+
"zip:firefox": "cross-env TARGET=firefox wxt zip -b firefox",
1414
"compile": "tsc --noEmit",
1515
"postinstall": "wxt prepare"
1616
},
@@ -66,6 +66,7 @@
6666
"@types/react-syntax-highlighter": "^15.5.11",
6767
"@types/turndown": "^5.0.4",
6868
"autoprefixer": "^10.4.17",
69+
"cross-env": "^7.0.3",
6970
"postcss": "^8.4.33",
7071
"prettier": "3.2.4",
7172
"tailwindcss": "^3.4.1",

page-share.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Click the button below to deploy the code to Railway.
2323

2424
```bash
2525
git clone https://github.com/n4ze3m/page-share-app.git
26-
cd page-assist-app
26+
cd page-share-app
2727
```
2828

2929
2. Run the server

src/assets/locale/en/playground.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"ollamaState": {
33
"searching": "Searching for Your Ollama 🦙",
44
"running": "Ollama is running 🦙",
5-
"notRunning": "Unable to connect to Ollama 🦙"
5+
"notRunning": "Unable to connect to Ollama 🦙",
6+
"connectionError": "It seems like you are having a connection error. Please refer to this <anchor>documentation</anchor> for troubleshooting."
67
},
78
"formError": {
89
"noModel": "Please select a model",

src/assets/locale/en/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@
245245
"webSearchFollowUpPromptHelp": "Do not remove `{chat_history}` and `{question}` from the prompt.",
246246
"webSearchFollowUpPromptError": "Please input your Web Search Follow Up Prompt!",
247247
"webSearchFollowUpPromptPlaceholder": "Your Web Search Follow Up Prompt"
248+
},
249+
"advanced": {
250+
"label": "Advance Ollama URL Configuration",
251+
"urlRewriteEnabled": {
252+
"label": "Enable or Disable Custom Origin URL"
253+
},
254+
"rewriteUrl": {
255+
"label": "Custom Origin URL",
256+
"placeholder": "Enter Custom Origin URL"
257+
},
258+
"help": "If you have connection issues with Ollama on Page Assist, you can configure a custom origin URL. To learn more about the configuration, <anchor>click here</anchor>."
248259
}
249260
}
250261
},

src/assets/locale/ja-JP/playground.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"ollamaState": {
33
"searching": "Ollamaを検索中 🦙",
44
"running": "Ollamaが実行中 🦙",
5-
"notRunning": "Ollamaに接続できません 🦙"
5+
"notRunning": "Ollamaに接続できません 🦙",
6+
"connectionError": "接続エラーが発生しているようです。トラブルシューティングについては<anchor>ドキュメント</anchor>をご覧ください。"
67
},
78
"formError": {
89
"noModel": "モデルを選択してください",

src/assets/locale/ja-JP/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@
248248
"webSearchFollowUpPromptHelp": "プロンプトから`{chat_history}`と`{question}`を削除しないでください。",
249249
"webSearchFollowUpPromptError": "Web検索フォローアッププロンプトを入力してください!",
250250
"webSearchFollowUpPromptPlaceholder": "Web検索フォローアッププロンプト"
251+
},
252+
"advanced": {
253+
"label": "Ollama URL の高度な設定",
254+
"urlRewriteEnabled": {
255+
"label": "カスタムOriginのURLを有効化または無効化する"
256+
},
257+
"rewriteUrl": {
258+
"label": "カスタムOriginのURL",
259+
"placeholder": "カスタムOriginのURLを入力"
260+
},
261+
"help": "PageAssistでOllamaに接続の問題がある場合は、カスタムOriginのURLを設定できます。設定の詳細については、<anchor>ここをクリック</anchor>してください。"
251262
}
252263
}
253264
},

0 commit comments

Comments
 (0)