Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Chrome Linux support #1

Open
thalesmello opened this issue Sep 27, 2016 · 5 comments
Open

Include Chrome Linux support #1

thalesmello opened this issue Sep 27, 2016 · 5 comments

Comments

@thalesmello
Copy link
Owner

I would like to include support for Linux, but, as of now, I don't know exactly
what is the best way to accomplish that.

The way this plugin works on the Mac is that it uses Apple Script to communicate
with an Open Instance of Chrome, which in its turn implements an interface of communication. With it I'm able to execute arbitrary JavaScript code in the currently opened page, so I run document.body.innerText to get the page text. Then I parse it and plug into the Vim completion engine.

After research, I've found two possible strategies:

  • Start Chrome in remote debugging mode, which then allows you to
    communicate with Chrome via HTTP requests. It has the inconvenience that Chrome
    has to be started using --remote-debugging-port=9222. Maybe that could be a
    lesser burden if we include a command such as :WebCompleteBrowser that already
    starts the browser with the appropriate flags.
  • Use Chrome native messaging protocol, which could then, on each page
    change, write the text of the current page to a temporary file in the operating
    system.
@baongoc124
Copy link

I just implemented a working version of it in Chrome Linux using 1st method because it's easier for me. Here's the script in case anyone wants to use it.
https://gist.github.com/baongoc124/ab7fab56f9f95363c75ff79b19257b60

@brunogsa
Copy link

brunogsa commented Feb 6, 2018

I'm also interested on adding support for Chrome Linux, probably using the Chrome Native Messaging Protocol.

Just in case, did you do something I can use as a base, @thalesmello ?

@thalesmello
Copy link
Owner Author

Thanks for your support @brunogsa

I hadn't started working on this yet. A native client support would be more than welcome!

@brunogsa
Copy link

I tried to find the simplest solution available, but the best option for now seems to create a Chrome Extension that gather the words, so we can source them into vim.

This plugin would required the user install this extension.
What do you think about it?

Also, I'm concerned about the performance.
I'm still studying if it's possible to gather words only when a window / tab become active.

Sorry about my absence,
Let me know what you think!

@thalesmello
Copy link
Owner Author

thalesmello commented Feb 22, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants