From 67aaae56f08cbd4f27d70f32a1039612fefc7807 Mon Sep 17 00:00:00 2001 From: Pierre Jacquier Date: Fri, 14 Jul 2023 06:41:11 -0400 Subject: [PATCH] Unsupported blob pages getting injected (#318) Fixes #312 --- src/chrome/content.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/chrome/content.ts b/src/chrome/content.ts index ffcd5e9..57d1c0a 100644 --- a/src/chrome/content.ts +++ b/src/chrome/content.ts @@ -11,6 +11,7 @@ import { getGithubCommitWithinPullUrlParams, } from './web' import gitHubInjection from 'github-injection' +import { isFilenameSupported } from './diff' const root = createReactRoot(document) @@ -141,9 +142,11 @@ async function run() { const blobParams = getGithubBlobUrlParams(url) if (blobParams) { const { owner, repo, sha, filename } = blobParams - console.log('Found blob diff: ', owner, repo, sha, filename) - await injectBlob(owner, repo, sha, filename, window.document) - return + if (isFilenameSupported(filename)) { + console.log('Found supported blob: ', owner, repo, sha, filename) + await injectBlob(owner, repo, sha, filename, window.document) + return + } } }