3
3 Comments

Adding a rich text editor to Chrome Extension

Hey there

Has anyone had any success adding a rich text editor to a Chrome extension? Somelike like quill.js or Trix, for example.

I can set/open/edit these text editors in a normal html/JS webpage, but something always seems to be off when I duplicate my code in a Chrome content.js page.

Any advice or sample code of someone that has successfully done this would be helpful!

Also FWIW, it doesn't ever seem to be a manifest.json permissions issue of allowing the external scripts for these packages to run

Thanks.

posted to Icon for group Browser Extension Makers
Browser Extension Makers
on August 17, 2020
  1. 1

    Rich tech editors like quill.js use script tags to load the text editor. In manifest v3, external scripts are not allowed. You might be getting an error on the console like this. This is the TinyMCE editor->
    ""contentScript.bundle.js:68677 Refused to load the script 'something.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules'. Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.""

    To solve this problem, use the module bundler to bundle the text editor and be able to use it without scripts

  2. 1

    We are having the same problem. Did you ever solve this?

    1. 1

      I wish, but unfortunately not.

  3. 1

    This comment was deleted 6 years ago.

Trending on Indie Hackers
6 weeks solo, 2 rejections, finally live but nobody told me marketing would be this hard User Avatar 102 comments Building ExpenseSpy solo, no funding — launching June 17 on iOS & Android User Avatar 45 comments I built a $5/1k-listing CRE data API because CoStar is overkill for first-pass scans User Avatar 18 comments Day 7: 51 people answered my question. I wasn't ready for what they said. User Avatar 18 comments Building LinkCover – Day 3: Payment is live. No more building, time to sell. User Avatar 15 comments I Was Bypassing Every App Blocker, So I Built One That Fights Back User Avatar 11 comments