diff options
author | 2020-10-16 15:18:36 -0400 | |
---|---|---|
committer | 2020-10-16 15:18:36 -0400 | |
commit | 24c04005b85e19b5958530e1a4092cbe8c072732 (patch) | |
tree | a02bc8e129e3bf9a7ca3782b149bc0a4a9281657 /source/features/embed-gist-inline.tsx | |
parent | 2fca2e2928cab038c54f5610b4afdb0ef798f597 (diff) | |
download | refined-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.tsx | 9 |
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 }); |