1995eaton / chromium-vim

Vim bindings for Google Chrome.
https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh
MIT License
2.25k stars 326 forks source link

[Chrome 80.0.3955.4] hints broken - Element.createShadowRoot deprecated #716

Open rprimus opened 4 years ago

rprimus commented 4 years ago

Sun Nov 3 22:24:36 GMT 2019

As of Chrome 80.0.3955.4, hints are broken. This is beacause:

[Deprecation] Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.

It has been replaced by attachShadow from ShadowDom v1.

This is causing the following errors in the console:

22:26:07.025 hints.js:727 Uncaught TypeError: main.createShadowRoot is not a function
    at hints.js:727
(anonymous) @ hints.js:727
setTimeout (async)
Hints.create @ hints.js:679
createHintWindow @ mappings.js:428
Mappings.convertToAction @ mappings.js:1152
down @ keys.js:733
(anonymous) @ keys.js:154
rprimus commented 4 years ago

Mon Nov 4 00:01:46 GMT 2019

To get hints working again: in hints.hs:727, replace call to main.createShadowRoot() with main.attachShadow({mode: 'open'})

zxteloiv commented 4 years ago

Mon Nov 4 00:01:46 GMT 2019

To get hints working again: in hints.hs:727, replace call to main.createShadowRoot() with main.attachShadow({mode: 'open'})

Thanks! I followed the simple suggestion and have made the hints perfect after rebuilding. Hope the version in Chrome Store could get updated soon.

My Env: macOS 10.13.6 Microsoft Edge 80.0.345.0 (based on Chromium).

grandsilence commented 4 years ago

Have the same issue on Mac OS 10.14.6, Google Chrome 81.0.4000.3 (dev branch)

grandsilence commented 4 years ago

When new version will be uploaded to Chrome Market? Thank you.

ShawnConn commented 4 years ago

The #719 PR fix hasn't been merged yet to resolve this issue with Chrome80

zyf0330 commented 4 years ago

Is there any way to hack this solution by tampermonkey?

dcchambers commented 4 years ago

For anyone coming from the web trying to fix this problem:

For now you'll have to manually install the extension from user @antonioyon's fork.

  1. Clone the repo: https://github.com/antonioyon/chromium-vim/tree/issue-716-fix-broken-hints
  2. Switch branches to issue-716-fix-broken-hints
  3. Install npm if you don't have it already.
  4. Run npm install and then make.
  5. Go to chrome://extensions in browser and select the "Load Unpacked Extension" button (may need developer mode enabled).
  6. Navigate to the directory with the code from above.
YourSouLi5Mine commented 4 years ago

I confirm what @dcchambers said. It works smoothly!

dany74q commented 4 years ago

Thanks @dcchambers - works great.

Side note: I've moved to use vimium, it provides an equivalent set of functionality, and hint creation worked out of the box (I believe it's more actively maintained as well)

zyf0330 commented 4 years ago

But vimium has no external editor feature.

On Sun, Feb 16, 2020, 21:56 Danny Shemesh notifications@github.com wrote:

Thanks @dcchambers https://github.com/dcchambers - works great.

Side note: I've moved to use vimium, it provides an equivalent set of functionality, and hint creation worked out of the box (I believe it's more actively maintained as well)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/1995eaton/chromium-vim/issues/716?email_source=notifications&email_token=AC3HTAOV4L7OACFT4RMTKL3RDFAYJA5CNFSM4JINMDFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL4H3SI#issuecomment-586710473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3HTAI2CS2643T7W4WVIETRDFAYJANCNFSM4JINMDFA .

DavidGretzschel commented 4 years ago

And Vimium doesn't allow for opening multiple links with mf. Or copying the link of a hint with yf. It's not the luxury I'm used to :(

DavidGretzschel commented 4 years ago

For anyone coming from the web trying to fix this problem:

For now you'll have to manually install the extension from user @antonioyon's fork.

  1. Clone the repo: https://github.com/antonioyon/chromium-vim/tree/issue-716-fix-broken-hints
  2. Switch branches to issue-716-fix-broken-hints
  3. Install npm if you don't have it already.
  4. Run npm install and then make.
  5. Go to chrome://extensions in browser and select the "Load Unpacked Extension" button (may need developer mode enabled).
  6. Navigate to the directory with the code from above.

ehhh.... looks kinda intimidating (at least on Windows). Is this even doable on Windows 10?

DavidGretzschel commented 4 years ago

@dcchambers doesn't work with Windows. The npm stuff was doable. Tried for hours to make gnuWin32 give me make which didn't work. Ended up being able to use make working with Cygwin.

Am I missing something here? Step 6 just means to add "C:\Users\david\GitHub repositories\chromium-vim" after it's all done, yes? Edit: To be more specific: t works, jk works but no link hints whatsoever :(

DavidGretzschel commented 4 years ago

ah nvm, wrong fork. Can confirm that this will work and is doable in Windows. A guide for those who are not used to doing any of this in Windows to fill in some missing details.

get the npm stuff here (is included in the json installer) https://nodejs.org/en/ Get Cygwyin here (make will be one of the default-installed packages). http://www.cygwin.com Install. Add this variable to PATH: C:\cygwin64\bin

Open an admin console and cd to the cloned repo. npm install then: make then: in Chrome select the folder of the repo as an extension.

CodyReichert commented 4 years ago

Thanks @dcchambers.

This isn't a satisfactory solution for people who use Chrome on multiple computers, unfortunately. And since no changes have been put on master in over a year, I fear we may be stuck looking for an alternative.

I'll try to get a cvim2 or somesuch extension packaged up and pushed to the Chrome Web Store (or maybe someone will beat me to it). I love cVim and don't want to see it fall to the wayside.

zgldh commented 4 years ago

I recommend this one http://vimium.github.io/

zyf0330 commented 4 years ago

it doesn't support some features cVim support.

On Sun, May 10, 2020, 20:45 zgldh notifications@github.com wrote:

I recommend this one http://vimium.github.io/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/1995eaton/chromium-vim/issues/716#issuecomment-626322809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3HTAJS4DPEPS5ELU6MTKLRQ2OXFANCNFSM4JINMDFA .

tyage commented 3 years ago

FYI I saw this extension in chrome web store was updated to 1.3 in 2021-03-25 although this github repository hasn't updated yet. https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh Diffs shows that the purpose of this update is to fix broken hints.

diff -r 1.2.99_0/content_scripts/hints.js 1.3_0/content_scripts/hints.js
727c727
<     Hints.shadowDOM = main.createShadowRoot();
---
>     Hints.shadowDOM = main.attachShadow({ mode: 'open' });