-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Support wakatime-chrome extension #237
Comments
Very unfortunate! I opened wakatime/browser-wakatime#130 in the upstream repo, let's see if some solution can be found. @shyn, are you using wakapi.dev or a self-hosted instance? |
I use a self-hosted instance. |
It may not easy to implement. I have a deep dive into it. The chrome extension defines the host permission here https://github.com/wakatime/chrome-wakatime/blob/master/manifest.json#L35 I updated the heartbeat URL to my own wakapi deployment and it issued CORS problem. After I solved the problem with supporting OPTIONS in wakapi, the ajax post request from the chrome extension does not come with cookies because of this Still trying to fix it now. |
I ran the chrome extension successfully, but we cannot get the correct os/editor/machine because of the user-agent. The user-agent from the browser looks like wakapi cannot parse it. |
I updated these parts in the chrome extension:
|
Thanks for investigating! I'll have a look at the user agent issue soon. |
Thanks! We can maintain a chrome-wakatime fork to support wakapi.dev. But it is hard to keep one extension for all self-hosted instances. We need to work around ajax/chrome extension CORS problems. |
I have a good solution in mind and will implement it soon. Stay tuned! |
Okay, so here's the plan:
Right now, this is blocked by wakatime/browser-wakatime#135. Unfortunately, I can't properly build the plugin, so I can't continue with the above points. Maybe it's only me, but otherwise we'll have to wait for someone to fix the plugin build. Also, help is highly appreciated here, especially because the plugin is written in React, which I don't have any expertise with. |
I can help with it. I am a backend guy but used to hack on chrome wakatime plugin. Will see what I can do here. |
@gaocegege Are you still on this? |
Yeah but do not have much bandwidth for it. 😟 |
Sorry, I don't want to pressure you. If you think you can't afford time for this more or less soon-ish then I'll have a look. However, it's probably gonna take me much longer, as I'm not familiar with React, etc. |
I just found wakapi but I am very love it and I am intending to support this task but I found this extension uses manifest v2. I don't know if wakatime has any plans to move to v3 version?🤪🤪 |
@f97 How is going forward with your extension? Is there anything we can help you with? |
@muety I have a bit of free time these days so I quickly code a small extension, but I'm having a problem that I don't know what to push. I tried a few things but still not satisfied, you can contribute here. At least it works but it doesn't work properly: 3 |
That is great news! I'm excited to check out what you already came up with. Maybe you can add a brief list of things that would still need to be done / are not working yet - e.g. in the form of issues or as part of your project's README - and I'm sure people will be happy to jump in and contribute to get this thing live! 🚀 And of course, don't feel obliged here by any means! Get your private stuff sorted and only spend time on coding this if you actually feel like so. |
I like the relay idea although it would be easier with dynamic hosts of course but I guess that's not possible. if the wakapi host would be provided (i.e. Of course this would mean, that a new wakapi container image must be pulled to get the updated extension but on the other hand this would also make sure that the API always matches. And I think there's an extra warning when installing extensions from other hosts. But other than that it would be nice because users know that they don't have to send their activities via a third party. I'm not sure whether any of what I wrote makes any sense, though. 😉 |
I'll have a look into content scripts to see if that could help us by any means. Thanks for the pointer. Apart from that, if I got your solution approach (building the extension with custom API URL at container build- / run time) correctly, it would mean that everyone, who is self-hosting Wakapi, would have to build and install their own browser extension, no? Of course, this is always an option. But I'd like to have a solution where people can just go to the Chrome / Firefox store and install an official add-on right from the marketplace. However, the main blocker on this ticket is anyways the extension itself, which would require a few adaptions, but whose code unfortunately seems to be abandoned. Again, if anyone has good expertise with (a) React and (b) the WebExt API, help is highly appreciated here! 🙂 |
wakatime/browser-wakatime#135 finally got resolved in the upstream repo, so no more blockers for us! 🙌 Next steps: as described above. I'd be super thankful if someone with a bit of React experience could help out in this! @qhantom, maybe? 😇 |
Sure, gonna have a look at https://github.com/muety/chrome-wakapi/issues/2 :-) |
@muety I also got the official chrome-wakatime plugin compiled and successfully installed, after I changed the URL in the source to my wakapi server. my Wakapi server recieves the requests:
But I don't see anything in my dashboard (besides my NeoVim plugin entries). I also don't see any domains showing up in the Dashboard. |
Hi @varac, thanks for reporting this! To clarify, you don't see your coding time reflected in the Wakapi dashboard at all or is it just classified as unknown? Also, do you see any error messages in the server's logs? The user agent issue from above most likely still persists. I'll look into it soon! |
I fixed parsing the user agent strings, so you should see "Chrome" appearing as an editor now. However, I realized that domains / web pages are implemented as entities (aka. files), while Wakapi currently does not support file statistics at the moment. I'll have to reconsider this, because otherwise, the browser plugin would be rather useless. |
Great! As soon as there's a new image tag I'll test and can give feedback. Thanks! |
browser-wakatime now supports sending data to Wakapi. See instructions here. ✔️ |
Installed chrome extension from wakatime.com. It's seems like I can't set the api endpoint. So the only way is the clone the source code and replace wakatime api with wakapi?
Searched issues found nothing about this.
The text was updated successfully, but these errors were encountered: