in each of the js files, background.js, sidebar.js, options,js, and content.js, I added some logic to support chrome. where possible I left the code untouched. I did a diff compare to align my sections with yours.
one assumption I made is that we want this to work with firefox and chrome, so in background.js and sidebar.js there is a check for firefox at the very top of the file. If you want this to run on alternate browsers this section will need to be modified. I believe the check logic in options.js and content.js will work with any firefox like browser and chrome.
I slightly modified the sidebar.css to compress the total vertical screen space, this is just cosmetic.
Firefox remains in manifest v2, so the manifest.json should be the same or modified very very slightly, for Chrome I set it up for manifest v3.
Both Firefox and Chrome want manifest.json to be named exactly that, but each requires a different manifest. In this pull request the Firefox one is manifest.json, and the Chrome one is currently named manifest_ch.json, which of course will need to be renamed to import into Chrome.
My thought is that the code can be maintained as is, and the user simply needs to have the right manifest.
Last, but not least. I have tested this with my Ollama instance on both Firefox and Chrome (current patch levels as of 10/15/2024) on Windows 11, and both work exactly as currently desired.
in each of the js files, background.js, sidebar.js, options,js, and content.js, I added some logic to support chrome. where possible I left the code untouched. I did a diff compare to align my sections with yours.
one assumption I made is that we want this to work with firefox and chrome, so in background.js and sidebar.js there is a check for firefox at the very top of the file. If you want this to run on alternate browsers this section will need to be modified. I believe the check logic in options.js and content.js will work with any firefox like browser and chrome.
I slightly modified the sidebar.css to compress the total vertical screen space, this is just cosmetic.
Firefox remains in manifest v2, so the manifest.json should be the same or modified very very slightly, for Chrome I set it up for manifest v3.
Both Firefox and Chrome want manifest.json to be named exactly that, but each requires a different manifest. In this pull request the Firefox one is manifest.json, and the Chrome one is currently named manifest_ch.json, which of course will need to be renamed to import into Chrome.
My thought is that the code can be maintained as is, and the user simply needs to have the right manifest.
Last, but not least. I have tested this with my Ollama instance on both Firefox and Chrome (current patch levels as of 10/15/2024) on Windows 11, and both work exactly as currently desired.