firenvim icon indicating copy to clipboard operation
firenvim copied to clipboard

doesnt work to edit files on github

Open nobodyatandnothing opened this issue 3 years ago • 6 comments

  • OS Version: clear linux 35470
  • Browser Version: Firefox 95.0.2
  • Browser Addon Version: 0.2.11
  • Neovim Plugin Version: 0.2.11

What I tried to do

edit https://github.com/nobodyatandnothing/test/blob/main/test

What happened

firenvim doesnt run

nobodyatandnothing avatar Dec 27 '21 04:12 nobodyatandnothing

Hi, thanks you for trying Firenvim. Could you try to go through the steps of the troubleshooting guide ( https://github.com/glacambre/firenvim/blob/master/TROUBLESHOOTING.md ) and let me know what the result is?

glacambre avatar Dec 27 '21 06:12 glacambre

i went through the steps with no results. firenvim works nicely everywhere else, even github issues and comments

nobodyatandnothing avatar Dec 27 '21 07:12 nobodyatandnothing

Oh, I see, I thought you meant that Firenvim didn't work at all.

I can't try it at the moment but I suspect I will be able to reproduce this problem. Unfortunately I think it's pretty likely to be caused by Github security settings and that I won't be able to fix it because the browser extension APIs aren't powerful enough. I'll let you know what the problem is exactly when I'm in front of a computer :).

glacambre avatar Dec 27 '21 07:12 glacambre

thank you

nobodyatandnothing avatar Dec 27 '21 07:12 nobodyatandnothing

Huh, actually it looks like there aren't any CSP/security issues here, the editor seems to swallow the focus event that Firenvim relies on. Using

let g:firenvim_config = {
	\ 'localSettings': {
		\ 'github.com': { 'selector': 'textarea:not([readonly]), div[role="textbox"], #code-editor' }
	\}
\}

Is enough to make the firenvim frame pop up automatically and you can write to the page but somehow Github is unable to process the written output (can't get previewing to work). They probably have a postprocessor somewhere that needs to be called after the write to CodeMirror. Reverse-engineering Github's editor is going to be a very time-consuming task and I probably won't be able to work on that any time soon.

Thanks a lot for the report :).

glacambre avatar Dec 31 '21 13:12 glacambre

I wonder if they have some fallback system for if/when the full editor doesn't work. I wonder if you blocked some part of the CodeMirror instance from loading (say with an add block rule for testing) if it would revert to some simpler textarea based edit window that would be easier to work from.

alerque avatar Aug 11 '22 17:08 alerque