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

Browser addon support seems has issue #486

Closed
SettingDust opened this issue May 10, 2023 · 10 comments
Closed

Browser addon support seems has issue #486

SettingDust opened this issue May 10, 2023 · 10 comments

Comments

@SettingDust
Copy link

SettingDust commented May 10, 2023

Describe the bug
There isn't content in unknown project. But the time is recorded
图片
图片

How is it show in wakatime
图片

System information
Please provide information on:

@muety
Copy link
Owner

muety commented May 10, 2023

Hi @SettingDust, thanks for reporting this. Unfortunately, I can't really reproduce this. Seems to be working for me:

image

Can you tell which version of the browser plugin you are using and potentially even show your config (with API key redacted)?

@SettingDust
Copy link
Author

Firefox. Addon 3.0.12.
图片
图片

@SettingDust
Copy link
Author

And there is an error
图片

@SettingDust
Copy link
Author

SettingDust commented May 11, 2023

MB. After look into the addon console. Caused by CORS. Seems the addon haven't grant the permission for the host. Should be reported to addon repo

But why is there time recorded

@muety
Copy link
Owner

muety commented May 11, 2023

The original WakaTime browser add-on does only have permissions for wakatime.com. The issue was discussed in #237, as a result of which we developed chrome-wakapi which (a) also has permissions for wakapi.dev and (b) allows to relay heartbeats to any other host (e.g. wakapi.example.org) through the official Wakapi instance, so no additional host permission are required for self-hosted instances.

However, it of course only works for publicly accessible instance, you won't be able to reach localhost this way. If you want the add-on to send data to localhost, there's no way around building the plugin yourself with custom host permissions compiled in.

But why is there time recorded

Could be coincidence? Are you using Wakapi with any other plugins (e.g. VSCode, IntelliJ, etc.)? If yes, probably one of them has sent heartbeats for "unknown" project.

@SettingDust
Copy link
Author

Well. Grant permission should be a feature for the addon

@muety
Copy link
Owner

muety commented May 11, 2023

Permissions must be defined at compile time via host_permissions in the manifest.json file. That's a requirement of the WebExtension API and adds to security. In my understanding, there's no way to retroactively allow an add-on to make requests to hosts that were not specified in the manifest. The whole discussion in #237 is around just that. Please correct me if I'm wrong.

@SettingDust
Copy link
Author

SettingDust commented May 11, 2023

https://github.com/SettingDust/obsidian-web-clipper/blob/main/src/app/options/general/general.component.ts#L46-L52

Can grant permission with this

EDIT: Need add to optional section in manifest

@muety
Copy link
Owner

muety commented May 11, 2023

Very cool, didn't know that! I filed an issue with the official plugin, see wakatime/browser-wakatime#209. Maybe we can even get rid of chrome-wakapi in the long run.

@muety
Copy link
Owner

muety commented Jul 8, 2023

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

No branches or pull requests

2 participants