WIP: Dodaj wsparcie dla Dockera #128
11
memory.ts
11
memory.ts
@ -13,7 +13,14 @@ function setDomainsCount(counter: number, tabId: number) {
|
|||||||
|
|
||||||
export default class Memory extends SaferEmitter {
|
export default class Memory extends SaferEmitter {
|
||||||
origin_to_history = {} as Record<string, Record<string, RequestCluster>>;
|
origin_to_history = {} as Record<string, Record<string, RequestCluster>>;
|
||||||
|
private firstRequestLogged = false;
|
||||||
|
|
||||||
async register(request: ExtendedRequest) {
|
async register(request: ExtendedRequest) {
|
||||||
|
// Log first intercepted request to confirm extension is working
|
||||||
|
if (!this.firstRequestLogged) {
|
||||||
|
console.error('[RENTGEN] First request intercepted!', request.url);
|
||||||
|
this.firstRequestLogged = true;
|
||||||
|
}
|
||||||
await request.init();
|
await request.init();
|
||||||
if (!request.isThirdParty()) {
|
if (!request.isThirdParty()) {
|
||||||
return;
|
return;
|
||||||
@ -45,6 +52,7 @@ export default class Memory extends SaferEmitter {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
console.error('[RENTGEN] Memory constructor starting - setting up webRequest listeners...');
|
||||||
|
|
||||||
browser.webRequest.onBeforeRequest.addListener(
|
browser.webRequest.onBeforeRequest.addListener(
|
||||||
async (request) => {
|
async (request) => {
|
||||||
@ -63,6 +71,7 @@ export default class Memory extends SaferEmitter {
|
|||||||
{ urls: ['<all_urls>'] },
|
{ urls: ['<all_urls>'] },
|
||||||
['requestHeaders']
|
['requestHeaders']
|
||||||
);
|
);
|
||||||
|
console.error('[RENTGEN] Memory constructor complete - webRequest listeners registered for all URLs!');
|
||||||
}
|
}
|
||||||
|
|
||||||
emit(eventName: string, data = 'any'): boolean {
|
emit(eventName: string, data = 'any'): boolean {
|
||||||
@ -100,9 +109,11 @@ export default class Memory extends SaferEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function init() {
|
export function init() {
|
||||||
|
console.error('[RENTGEN] Extension initializing...');
|
||||||
const memory = new Memory();
|
const memory = new Memory();
|
||||||
|
|
||||||
(window as any).memory = memory;
|
(window as any).memory = memory;
|
||||||
|
console.error('[RENTGEN] Extension initialized successfully! Ready to intercept requests.');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMemory(): Memory {
|
export function getMemory(): Memory {
|
||||||
|
|||||||
@ -29,12 +29,23 @@ WEBEXT_PID=$!
|
|||||||
|
|
||||||
# Wait for extension installation confirmation
|
# Wait for extension installation confirmation
|
||||||
echo "Waiting for extension to install..."
|
echo "Waiting for extension to install..."
|
||||||
|
EXTENSION_CODE_EXECUTED=false
|
||||||
for i in {1..30}; do
|
for i in {1..30}; do
|
||||||
if grep -q "Installed /app as a temporary add-on" /tmp/web-ext.log 2>/dev/null; then
|
if grep -q "Installed /app as a temporary add-on" /tmp/web-ext.log 2>/dev/null; then
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo "✓ SUCCESS: Extension installed!"
|
echo "✓ SUCCESS: Extension installed!"
|
||||||
echo "✓ Firefox is running in headless mode"
|
echo "✓ Firefox is running in headless mode"
|
||||||
echo "✓ Extension: rentgen@internet-czas-dzialac.pl"
|
echo "✓ Extension: rentgen@internet-czas-dzialac.pl"
|
||||||
|
|
||||||
|
# Check if extension code actually executed
|
||||||
|
sleep 2
|
||||||
|
if grep -q "\[RENTGEN\] Extension initialized successfully!" /tmp/web-ext.log 2>/dev/null; then
|
||||||
|
echo "✓ Extension code executed - webRequest listeners active!"
|
||||||
|
EXTENSION_CODE_EXECUTED=true
|
||||||
|
else
|
||||||
|
echo "⚠ Extension installed but code execution not confirmed yet..."
|
||||||
|
fi
|
||||||
|
|
||||||
echo "✓ Process info:"
|
echo "✓ Process info:"
|
||||||
ps aux | grep -E "(firefox|Xvfb)" | grep -v grep | head -3
|
ps aux | grep -E "(firefox|Xvfb)" | grep -v grep | head -3
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
@ -44,5 +55,13 @@ for i in {1..30}; do
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Show Rentgen-specific logs if found
|
||||||
|
if [ "$EXTENSION_CODE_EXECUTED" = true ]; then
|
||||||
|
echo ""
|
||||||
|
echo "Extension initialization logs:"
|
||||||
|
grep "\[RENTGEN\]" /tmp/web-ext.log 2>/dev/null | head -5 || true
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
# Keep container running and show logs
|
# Keep container running and show logs
|
||||||
wait $WEBEXT_PID
|
wait $WEBEXT_PID
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user