Skip to content

Commit 4184941

Browse files
committed
Wire up the playground.
1 parent 854d10c commit 4184941

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

browser-extension/src/entrypoints/content.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import { CONFIG } from '../lib/config'
22
import { logger } from '../lib/logger'
33
import { EnhancerRegistry, TextareaRegistry } from '../lib/registries'
4+
import { githubPrNewCommentContentScript } from '../playgrounds/github-playground'
45

56
const enhancers = new EnhancerRegistry()
67
const enhancedTextareas = new TextareaRegistry()
78

89
export default defineContentScript({
910
main() {
11+
if (CONFIG.MODE === 'PLAYGROUNDS_PR') {
12+
githubPrNewCommentContentScript()
13+
return
14+
}
1015
const textAreasOnPageLoad = document.querySelectorAll<HTMLTextAreaElement>(`textarea`)
1116
for (const textarea of textAreasOnPageLoad) {
1217
enhanceMaybe(textarea)
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// Configuration constants for the extension
1+
const MODES = ['PROD', 'PLAYGROUNDS_PR'] as const
2+
3+
export type ModeType = (typeof MODES)[number]
4+
25
export const CONFIG = {
36
ADDED_OVERTYPE_CLASS: 'gitcasso-overtype',
4-
// Debug settings
5-
DEBUG: true, // Set to true to enable debug logging
6-
EXTENSION_NAME: 'gitcasso',
7-
INITIAL_SCAN_DELAY_MS: 100,
8-
MUTATION_OBSERVER_DELAY_MS: 100,
7+
DEBUG: true, // enabled debug logging
8+
EXTENSION_NAME: 'gitcasso', // decorates logs
9+
MODE: 'PLAYGROUNDS_PR' satisfies ModeType,
910
} as const

0 commit comments

Comments
 (0)