summaryrefslogtreecommitdiff
path: root/source/features/embed-gist-inline.tsx
diff options
context:
space:
mode:
authorGravatar yakov116 <16872793+yakov116@users.noreply.github.com> 2020-10-16 15:18:36 -0400
committerGravatar GitHub <noreply@github.com> 2020-10-16 15:18:36 -0400
commit24c04005b85e19b5958530e1a4092cbe8c072732 (patch)
treea02bc8e129e3bf9a7ca3782b149bc0a4a9281657 /source/features/embed-gist-inline.tsx
parent2fca2e2928cab038c54f5610b4afdb0ef798f597 (diff)
downloadrefined-github-24c04005b85e19b5958530e1a4092cbe8c072732.tar.gz
refined-github-24c04005b85e19b5958530e1a4092cbe8c072732.tar.zst
refined-github-24c04005b85e19b5958530e1a4092cbe8c072732.zip
Restore `embed-gist-inline` feature (#3640)
Co-authored-by: Federico <me@fregante.com>
Diffstat (limited to '')
-rw-r--r--source/features/embed-gist-inline.tsx9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/features/embed-gist-inline.tsx b/source/features/embed-gist-inline.tsx
index 711f3610..0bdb0e63 100644
--- a/source/features/embed-gist-inline.tsx
+++ b/source/features/embed-gist-inline.tsx
@@ -4,7 +4,6 @@ import select from 'select-dom';
import * as pageDetect from 'github-url-detection';
import features from '.';
-import {isFirefox} from '../github-helpers';
const isGist = (link: HTMLAnchorElement): boolean =>
!link.pathname.includes('.') && // Exclude links to embed files
@@ -20,8 +19,8 @@ async function embedGist(link: HTMLAnchorElement): Promise<void> {
link.after(info);
try {
- const response = await fetch(`${link.href}.json`);
- const gistData = await response.json();
+ // Get the gist via background.js due to CORB policies introduced in Chrome 73
+ const gistData = await browser.runtime.sendMessage({request: `${link.href}.json`});
const files = domify.one(gistData.div)!;
const fileCount = files.children.length;
@@ -60,9 +59,5 @@ void features.add({
include: [
pageDetect.hasComments
],
- exclude: [
- // https://github.com/sindresorhus/refined-github/issues/2022
- () => isFirefox
- ],
init
});