web-llm icon indicating copy to clipboard operation
web-llm copied to clipboard

chrome extension not working with manifest version 3 and google will be stopping manifest version 2 in January, 2024

Open manuongithub opened this issue 1 year ago • 12 comments

chrome extension not working with manifest version 3 and Google will be stopping manifest version 2 in January, 2024

Are there any plans to make the extension work with manifest version 3?

manuongithub avatar Nov 13 '23 19:11 manuongithub

chrome is pointing to the following line in @mlc/ai/web-tokenizers/lib : Screenshot 2023-11-13 at 4 48 24 PM

var r = constructor.apply(obj, argumentList);

manuongithub avatar Nov 14 '23 00:11 manuongithub

I think, https://stackoverflow.com/questions/64698248/chrome-extension-refused-to-evaluate-a-string-as-javascript-because-unsafe-eval provides the root cause and solution

manuongithub avatar Nov 14 '23 01:11 manuongithub

can we use -s NO_DYNAMIC_EXECUTION=1 when building the webtokenizer lib at https://github.com/mlc-ai/tokenizers-cpp/tree/main/web ?

manuongithub avatar Nov 14 '23 01:11 manuongithub

cc @tqchen , @sudeepag

manuongithub avatar Nov 14 '23 01:11 manuongithub

ok, I can confirm, that above mentioned worked for my chrome extension which uses manifest 3.

I had to change the build.sh in tokenizers-cpp/web to add -s NO_DYNAMIC_EXECUTION=1

then pack the resultant module and include it in package.json of web-llm

after buiding web-llm from source, I was able to get manifest 3 to work.

manuongithub avatar Nov 14 '23 08:11 manuongithub

Thank you @manuongithub , do you mind send a PR to okenizers-cpp/web

tqchen avatar Nov 14 '23 19:11 tqchen

@tqchen pls. check the pull request at - https://github.com/mlc-ai/tokenizers-cpp/pull/20 If you approve this then I'll update the chrome extension code too so that it starts using manifest 3

manuongithub avatar Nov 17 '23 23:11 manuongithub

can we please get a web-llm release to bump the upstream tokenizers-cpp to 0.1.2? i'm assuming that's what's needed next without building from source?

darvid avatar Nov 26 '23 23:11 darvid

cc @CharlieFRuan

tqchen avatar Nov 27 '23 01:11 tqchen

@darvid Updated to 0.2.10 to reflect tokenizer's 0.1.2. Sorry for the delay

CharlieFRuan avatar Nov 28 '23 20:11 CharlieFRuan

thanks @CharlieFRuan , @tqchen - I will change manifest to ver 3 now and raise a PR. Do you want me to also put the extension in the chrome webstore now that manifest 3 is supported?

manuongithub avatar Dec 01 '23 22:12 manuongithub

@tqchen, @CharlieFRuan pls. take a look at https://github.com/mlc-ai/web-llm/pull/218 which enables manifest version 3 for the chrome extension and also enables WebGPU usage out of the box instead of using the chrome extension using the local server.

manuongithub avatar Dec 02 '23 01:12 manuongithub