n4ze3m / page-assist

Use your locally running AI models to assist you in your web browsing
https://chromewebstore.google.com/detail/page-assist-a-web-ui-for/jfgfiigpkhlkbnfnbobbkinehhfdhndo
MIT License
1.2k stars 124 forks source link

Changing the font size? #55

Open n4ze3m opened 4 months ago

n4ze3m commented 4 months ago

Discussed in https://github.com/n4ze3m/page-assist/discussions/54

Originally posted by **gerroon** April 30, 2024 Is it possible to change the font size in the side bar? It is quite large compared to the font sizes in the web sites pages.
GreyTeddy commented 3 months ago

A perhaps easy fix would be to link the zoom "style" functionality to buttons - and +. The zoom can be easily changed by running document.body.style.zoom = 0.5 in the console for a 50% zoom out. Of course, buttons would be a proper solution to this.

I can make a PR with this change, if I have some free time.

GreyTeddy commented 3 months ago

Sadly, it looks like the zoom "style" functionality is not yet supported by Mozilla Firefox yet. As this extension is available there as well, it will be much more involved to add zoom functionality.

Which is extra sad, because I managed to quickly do a prototype, and it actually works well on Google Chrome 😅...

EDIT: It just got support today??? hahaha, it was in preview when I first wrote this and my local firefox does not support it. image

GreyTeddy commented 3 months ago

Given that it just got support (and I updated my local Firefox), I will still make a PR, and it can be decided later whether to be merged.

GreyTeddy commented 3 months ago

Typescript type CSSStyleDeclaration doesn't include zoom yet (left a comment)., but should work now, as I'll put a //@ts-ignore

Also, from my testing, it looks like Ctrl + Scroll Up/Down zooms in/out the side page! But only on Firefox, not Chrome. So I'm thinking adding a setting in the Settings page

n4ze3m commented 3 months ago

Hey, this is so cool ❤️! Btw, you can check which environment the extension is in using import.meta.env.BROWSER. For Chromium-based browsers, it will be 'chrome', and for Firefox, it will be 'firefox'.