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

Make compatible with refined-github #12

Open
willklein opened this issue Apr 12, 2016 · 5 comments
Open

Make compatible with refined-github #12

willklein opened this issue Apr 12, 2016 · 5 comments

Comments

@willklein
Copy link
Owner

On repo homeages for README files, Refined GitHub removes the header where the button is inserted. Place the button in the same container as their edit button.

@willklein
Copy link
Owner Author

This might be blocked, I don't see a way to know when the other extension has finished, and we can't just setTimeout due to a content security policy.

@DrewML
Copy link

DrewML commented Apr 12, 2016

@willklein Thanks for working on this - love the extension!

we can't just setTimeout due to a content security policy.

One of the Refined-GitHub PRs had this issue. You could try switching from setTimeout to a setInterval that clears itself in the callback.

If that's not ideal though, I'm sure we can find another way.

@sindresorhus
Copy link

Maybe refined-github could emit a global event when it's done?

@willklein
Copy link
Owner Author

@sindresorhus: Nice idea, I was thinking about that too. There might still be a race condition though. What if github-markdown-menu renders first, and then refined-github wipes out the header we modified?

Another approach is agreeing on a DOM container that, if present, we both update. Whoever renders first inserts the container, and whoever renders later updates it.

I think @DrewML's suggestion will probably work, I just didn't get a chance to try it yet. If so, that should delay rendering of github-markdown-menu so it always renders second, and then there are no changes needed in refined-github. I'll try that soon.

@willklein
Copy link
Owner Author

Oh, on second thought, @sindresorhus's idea to emit a global event could also work without a race condition. github-markdown-menu may render first, but if refined-github also renders, emits an event, then I just re-render github-markdown-menu. I still want to try the setInterval next.

Seems like these ideas are all "hacks," but that's what browser extensions are for. 😄

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