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

Restore embed-gist-inline feature #3640

Merged
merged 8 commits into from
Oct 16, 2020
Merged

Restore embed-gist-inline feature #3640

merged 8 commits into from
Oct 16, 2020

Conversation

yakov116
Copy link
Member

@yakov116 yakov116 commented Oct 12, 2020

@fregante fregante added bug and removed enhancement labels Oct 13, 2020
@yakov116
Copy link
Member Author

One sec I am getting lost in the comments

@yakov116 yakov116 requested a review from fregante October 15, 2020 00:46
// Get the gist via background.js due to CORB policies introduced in Chrome 73
const gistData = await browser.runtime.sendMessage({
action: 'fetch',
payload: `${link.href}.json`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we shorten this object to just being {fetch: 'blah blah json'}. Splitting payload from the action seems unnecessary (even though that’s how I’ve done it for years)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried doing this and typescript did not like me. Want me to commit?

Copy link
Member Author

@yakov116 yakov116 Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the official google docs say to do a check first so that any sendmessage that is passed does not end up by mistake fetched

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of check?

What does TypeScript say? It’s the same type, except that instead of calling the property payload it calls it fetch. That’s it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was that fetch is a reserved word.

Copy link
Member

@kidonng kidonng Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then got

Jokes aside, I think request is a better word

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was that fetch is a reserved word.

Ah the problem is in the destructuring part I suppose

@fregante
Copy link
Member

Code looks good. Hope you tested the latest version in both browsers

@yakov116
Copy link
Member Author

I did

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

Successfully merging this pull request may close these issues.

embed-gist-inline fails
3 participants