Skip to content

Commit 66a6a85

Browse files
committed
More diff minimization.
1 parent 91a8c13 commit 66a6a85

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

browser-extension/src/entrypoints/content.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import { EnhancerRegistry, TextareaRegistry } from '../lib/registries'
66
const enhancers = new EnhancerRegistry()
77
const enhancedTextareas = new TextareaRegistry()
88

9-
// Expose for debugging in har:view
10-
;(window as any).gitcassoTextareaRegistry = enhancedTextareas
9+
// Expose for debugging in har:view
10+
; (window as any).gitcassoTextareaRegistry = enhancedTextareas
1111

1212
function sendEventToBackground(type: 'ENHANCED' | 'DESTROYED', spot: CommentSpot): void {
1313
const message: CommentEvent = {
1414
spot,
1515
type,
1616
}
17-
1817
browser.runtime.sendMessage(message).catch((error) => {
1918
logger.debug('Failed to send event to background:', error)
2019
})

browser-extension/tests/har-view.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,10 @@ function injectGitcassoScript(key: keyof typeof PAGES, html: string) {
332332
console.log('Fetched content script, patching webextension-polyfill...');
333333
334334
// Replace the problematic webextension-polyfill error check
335-
let patchedCode = code.replace(
335+
const patchedCode = code.replace(
336336
/throw new Error\\("This script should only be loaded in a browser extension\\."/g,
337337
'console.warn("Webextension-polyfill check bypassed for HAR testing"'
338338
);
339-
340339
// Mock necessary APIs before executing
341340
window.chrome = window.chrome || {
342341
runtime: {
@@ -347,14 +346,10 @@ function injectGitcassoScript(key: keyof typeof PAGES, html: string) {
347346
}
348347
};
349348
window.browser = window.chrome;
350-
351-
352349
// Execute the patched script
353350
const script = document.createElement('script');
354351
script.textContent = patchedCode;
355352
document.head.appendChild(script);
356-
357-
358353
console.log('Gitcasso content script loaded with location patching for:', '${urlParts.href}');
359354
})
360355
.catch(error => {

0 commit comments

Comments
 (0)