From 131aff7cd287c1f09f57f469e2e81489796cb281 Mon Sep 17 00:00:00 2001
From: Federico Brigante <opensource@bfred.it>
Date: Sun, 8 Sep 2019 02:51:48 +0700
Subject: Avoid running `embed-gist-inline` in Firefox

It's just not supported by the browser.

Closes https://github.com/sindresorhus/refined-github/issues/2022
---
 source/features/embed-gist-inline.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'source/features/embed-gist-inline.tsx')

diff --git a/source/features/embed-gist-inline.tsx b/source/features/embed-gist-inline.tsx
index 45b51f7c..6ac2d838 100644
--- a/source/features/embed-gist-inline.tsx
+++ b/source/features/embed-gist-inline.tsx
@@ -38,7 +38,7 @@ async function embedGist(link: HTMLAnchorElement): Promise<void> {
 			);
 		}
 	} catch {
-		info.replaceWith(' (embed failed)');
+		info.remove();
 	}
 }
 
@@ -50,11 +50,15 @@ function init(): void {
 
 features.add({
 	id: __featureName__,
-	description: 'Embeds linked gists.',
+	description: 'Embeds linked gists. Not supported by Firefox.',
 	screenshot: 'https://user-images.githubusercontent.com/6978877/33911900-c62ee968-df8b-11e7-8685-506ffafc60b4.',
 	include: [
 		features.hasComments
 	],
+	exclude: [
+		// https://github.com/sindresorhus/refined-github/issues/2022
+		() => navigator.userAgent.includes('Firefox/')
+	],
 	load: features.onAjaxedPages,
 	init
 });
-- 
cgit v1.2.3

