glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.69k stars 145 forks source link

Content Security Policy issues when trying firevim with an Monaco based online IDE #1315

Open ThijmenStar opened 2 years ago

ThijmenStar commented 2 years ago

What I tried to do

My university (TU Delft) uses an online IDE for most of it's (computer science) courses called weblab. I would really like to use vim shortcuts in this online editor.

I did some digging and found out that under the hood they are using Monaco. I figured this extension should work and it did for the Monaco demo but unfortunately not for weblab's version.

What happened

Instead the editor flashes black for a fraction of a second and then returns to it's original state. This is what the js console is saying:

This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
[index.html](moz-extension://20838920-61a2-4482-bf02-540a3e9d307e/index.html)
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). 3 moz-extension
Error: unwrap(...).monaco is undefined undefined
Error: unwrap(...).monaco is undefined [input.ts:187:16](webpack://Firenvim/src/input.ts)
Error: unwrap(...).monaco is undefined undefined

It seems it has something to do with the sites Content Security Policy. Is there a way to bypass this somehow?

ThijmenStar commented 2 years ago

Might be the same issue as #1311 though I'm not sure it's caused by the same thing

glacambre commented 2 years ago

Hi, thanks for the report. I think you're right, this sounds like a CSP issue. If I figure out how to solve #1193 this problem might go away :).

albertas commented 2 years ago

Might be the same issue as #1311 though I'm not sure it's caused by the same thing

Yes, I confirm, that the cause of #1311 is the same. I get Content Security Policy: The page's settings blocked the loading of a resource at inline ("script-src"). error when trying to start Firenvim in AWS console.