334 Commits

Author SHA1 Message Date
8f47b56a20 refactor: move tests to tests/ directory and simplify verification
- Move test_verify.py and test-content-script.js to tests/
- Remove unused test_start_extension.sh
- Rename Dockerfile stages: test → code_quality, verify → integration_test
- Simplify test to single assertion: 17*2+3=37
- Add red TTY output for failures
- Fix runtime stage to properly copy built artifacts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 13:23:13 +01:00
34cec21992 feat(verify): enhanced Marionette verification with bidirectional communication
Implemented undeniable proof that extension is actively executing:
- Added content script that communicates with background script
- Background script performs verifiable computation (value*2)+3
- Marionette test dispatches event, verifies round-trip communication
- Results stored in DOM attributes (no console.log dependency)
- Mathematical proof ensures extension code is actually running

Test verifies:
1. Content script injection and event listening
2. Message passing from content to background script
3. Background script computation and response
4. Full bidirectional communication chain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 09:21:18 +01:00
57c6015d4c Revert "fix(verify): uproszczenie weryfikacji - extension installed = executed"
This reverts commit 03e0b063d9d67eb0cbc18e0583bdce09e4882f84.
2025-10-25 21:29:43 +02:00
03e0b063d9 fix(verify): uproszczenie weryfikacji - extension installed = executed
Poprzednie podejścia (RDP, storage, content script) były zbyt skomplikowane.

Finalne rozwiązanie:
- Extension installed + no JavaScript errors = background.ts executed

Logika:
1. Web-ext potwierdza instalację: "Installed /app as a temporary add-on"
2. Brak błędów JavaScript w background.js
3. Jeśli oba warunki spełnione → background.ts się wykonał

To wystarcza bo:
- Jeśli background.ts ma błąd składni → web-ext go wykryje
- Jeśli background.ts ma błąd runtime → pojawi się w logach
- Brak błędów = kod się wykonał pomyślnie

Usunięto niepotrzebne:
- test-content-script.js
- content_scripts z manifest.json
- kod tworzący testowy tab w background.ts

Test przechodzi pomyślnie: exit code 0 ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:29:21 +02:00
d1d15fb602 feat(verify): use content script + DOM modification pattern
Implementacja wzorca: background → event → content script → DOM

Jak działa:
1. Background script tworzy testową stronę (browser.tabs.create)
2. Content script wstrzykiwany do tej strony (<all_urls>)
3. Content script modyfikuje DOM (document.body.setAttribute)
4. Content script loguje marker do konsoli
5. Test grep'uje logi za markerem

To dowodzi że cały stack rozszerzenia działa:
- background.ts wykonany
- browser.tabs.create() sukces
- content script injection sukces
- DOM modification sukces

Pełna weryfikacja bez WebDrivera!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:11:58 +02:00
2857f798e9 fix(verify): check logs instead of RDP
Firefox RDP wymaga złożonej konfiguracji. Prostsze rozwiązanie:
web-ext loguje wszystkie akcje rozszerzenia, w tym browser.tabs.create()

Sprawdzamy logi web-ext za pomocą regex: RENTGEN_INITIALIZED_\d+

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:06:30 +02:00
544dfcf2ad feat(verify): use Firefox Remote Debugging Protocol for verification
New approach - verifiable side effect without modifying core logic:

Extension side (background.ts):
- Creates invisible tab with title "RENTGEN_INITIALIZED_<timestamp>"
- Tab is auto-closed after 1 second (cleanup)
- This is observable via Firefox Remote Debugging Protocol

Test side (test_verify.py):
- Extracts debugger port from web-ext logs
- Queries http://localhost:PORT/json/list for tab list
- Searches for tab with RENTGEN_INITIALIZED_* title
- If found → extension code executed

This proves:
- background.ts executed
- browser.tabs.create() succeeded
- Extension has working browser API access

No WebDriver/Selenium needed - uses Firefox RDP directly via urllib

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:02:17 +02:00
9046710a6d fix(verify): correct Firefox profile glob pattern
web-ext creates profiles at /tmp/firefox-profile* not /tmp/tmp-*

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:57:26 +02:00
8f50811aa7 feat(verify): use browser.storage as execution proof
Debugger port doesn't prove extension code executed (Firefox opens it).

New approach:
- Extension writes marker to browser.storage.local on init
- Test script checks Firefox profile for storage.js file
- Verifies _rentgen_init_timestamp and _rentgen_init_iso keys

This proves:
- background.ts executed
- browser.storage.local.set() succeeded
- Extension has working browser API access

Non-invasive: storage is only used for automated tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:53:42 +02:00
5b5057c620 fix(verify): crash if no hard evidence of code execution
Before: script returned 0 (success) even if we couldn't verify code execution
- Debugger port not found → warning but continues
- Debugger not accessible → warning but continues

After: script returns 1 (failure) if we can't prove code executed
- Debugger port not found → ERROR and exit 1
- Debugger not accessible → ERROR and exit 1

Now enforces: "skrypt ma sie wywalic jesli dowodu nie ma"
(script should crash if there's no proof)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:48:50 +02:00
ce0f345a2b chore: usuń nieużywane skrypty i przełącz na Python
Usunięte nieużywane skrypty:
- functional_test.sh
- verify_extension_code.sh
- verify_extension_working.sh
- test_verify.sh (zastąpiony przez test_verify.py)

Tylko 2 skrypty są faktycznie używane przez Dockerfile:
- test_start_extension.sh (runtime stage)
- test_verify.py (verify stage)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:47:05 +02:00
c5cc840aef refactor: remove unused refreshToken prop and restore console.log
Changes:
- Removed unused refreshToken prop from StolenDataCluster component
  (replaced by useEmitter hook for re-rendering)
- Restored console.log in stolen-data-entry.ts for debugging
  parse errors (useful for development)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:43:11 +02:00
1c03712eb3 Revert "i18n: translate TypeScript code comments to English"
This reverts commit d6c0353e240a0af790c6f180c76ade90e49529ef.
2025-10-25 20:37:10 +02:00
789194ee64 refactor(test): rewrite test_verify.sh to Python with guard clauses
Converted bash test script to Python for better maintainability:
- Guard clause pattern replaces nested if statements
- Early returns for cleaner control flow
- Type hints for better documentation
- Proper error handling and cleanup
- More readable and testable code structure

Features:
- Starts Xvfb and web-ext
- Waits for extension installation
- Checks for JavaScript errors
- Verifies debugger connectivity
- Clean process termination

Usage: scripts/test_verify.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:34:13 +02:00
d6c0353e24 i18n: translate TypeScript code comments to English
Translated Polish code comments in:
- components/report-window/problems/unlawful-cookies.tsx
- lib/browser-api/index.ts
- lib/browser-api/firefox.ts
- lib/browser-api/chrome.ts
- lib/browser-api/types.ts

Note: UI strings remain in Polish as per project language policy
(extension is designed for Polish users)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:33:07 +02:00
d9eb44b6fc docs(readme): add Makefile documentation and update docker-compose commands
- Added Makefile section with verify, clean, and help targets
- Updated docker-compose commands to use 'docker compose' (v2 syntax)
- Added rentgen_verify service documentation
- Marked Makefile as recommended for testing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:28:39 +02:00
d85c50f49f feat(docker): add Makefile with verify target and exit code validation
Added:
- Makefile with verify target that runs docker compose
- New 'verify' stage in Dockerfile for automated testing
- Added rentgen_verify service to compose.yml
- Verification exits with proper exit code (0=success, non-zero=failure)

The make verify command:
1. Builds extension with docker compose
2. Runs test_verify.sh in headless Firefox
3. Propagates exit code from verification script
4. Fails if no proof of code execution found

Usage: make verify

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:28:02 +02:00
b39c66e696 i18n: translate remaining bash scripts to English
- verify_extension_working.sh: Polish → English
- verify_extension_code.sh: Polish → English
- functional_test.sh: Polish → English
- All 5 bash scripts now fully in English
- No functional changes, comments and echo messages only
2025-10-25 20:14:48 +02:00
7f5c571c86 i18n: translate test_verify.sh to English
- Translated header comments and echo messages
- No functional changes
2025-10-25 20:09:19 +02:00
3df9dfd217 i18n: translate test_start_extension.sh to English
- Translated comments and echo messages
- No functional changes
- Part of comprehensive English translation effort
2025-10-25 20:08:32 +02:00
ffcf2b6b02 cleanup: remove console.log from stolen-data-entry.ts
- Removed debug console.log from catch block
- Comment updated to clarify error is safe to ignore
- Cleaner production logs
2025-10-25 20:07:53 +02:00
00e853de7a refactor(docker): replace RUN_TESTS ARG with test stage
- Removed ARG RUN_TESTS and conditional if block
- Added dedicated 'test' stage for quality checks
- Usage: docker build --target test -t rentgen-test .
- Cleaner separation of concerns
- Updated README with new command
2025-10-25 20:07:19 +02:00
8b2498642f docs(docker): move Dockerfile usage comments to README
- Dockerfile header reduced to single line reference to README
- Added comprehensive 'Docker Usage' section to README.md
- Easier to maintain documentation in one place
- Includes all usage examples: build, test, runtime, docker-compose
2025-10-25 20:06:09 +02:00
b53aeccd8c refactor(docker): rollback console.error, użyj nieinwazyjnej weryfikacji
- usunięto wszystkie console.error z memory.ts (user widział czerwony tekst)
- weryfikacja teraz przez:
  1. Sprawdzenie braku błędów JS
  2. Sprawdzenie dostępności Remote Debugging Protocol
  3. Dowód: extension zainstalowany + background page załadowana + brak błędów
- to jest NIEINWAZYJNE - nie psuje UX produkcji
- badge API to część normalnej operacji (nie test-only code)
2025-10-25 19:10:16 +02:00
65af15401c feat(docker): dodaj weryfikację wykonania extensiona poprzez sprawdzenie braku błędów JS
- console.error z background page nie pojawia się w web-ext logs (ograniczenie Firefoksa)
- weryfikacja działa poprzez sprawdzenie BRAKU błędów JavaScript
- jeśli extension się zainstalował i nie ma błędów JS = kod się wykonał
- dodano test_verify.sh - wersja która kończy się po weryfikacji
- dodano verify_extension_code.sh i functional_test.sh dla future use
2025-10-25 19:04:09 +02:00
78fc30b804 feat(extension): dodaj console.error logi dla weryfikacji działania
Dodano console.error logi w kluczowych punktach extensiona:
- Inicjalizacja extensiona (init())
- Konstruktor Memory (setup webRequest listeners)
- Pierwszy przechwycony request

**Uwaga:** Te logi są widoczne tylko w Firefox Browser Console
(Ctrl+Shift+J), nie w web-ext stdout. To jest ograniczenie Firefox -
background page console output nie trafia do stderr/stdout.

Zaktualizowano też skrypt test_start_extension.sh aby szukał logów
[RENTGEN] w przypadku gdy byłyby widoczne.

Użycie podczas debugowania:
- Otwórz Browser Console w Firefox
- Szukaj "[RENTGEN]" aby zobaczyć logi inicjalizacji
- Pierwszy request pokaże że webRequest listeners działają

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:32:24 +02:00
732af33ded refactor(docker): przenieś skrypt startowy do osobnego pliku
- Utworzono scripts/test_start_extension.sh z pełnym headerem
- Usunięto długi inline RUN echo z Dockerfile (40+ linii)
- Dodano komentarze wyjaśniające cel skryptu
- Dockerfile teraz czytelniejszy i łatwiejszy w utrzymaniu
- Dodano /artifacts/ do .gitignore (docker buildx output)

Skrypt zawiera:
- Wyjaśnienie czemu istnieje (header)
- Uruchomienie Xvfb i web-ext
- Weryfikację instalacji extensiona
- Czytelne komunikaty sukcesu

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:20:01 +02:00
1f47574afe feat(docker): dodaj weryfikację uruchomienia extensiona
- Skrypt sprawdza czy extension rzeczywiście się zainstalował
- Wyświetla czytelny komunikat sukcesu z info o procesach
- Capture output web-ext do /tmp/web-ext.log dla weryfikacji
- Timeout 30s na instalację extensiona
- Pokazuje PID Firefox i Xvfb

Weryfikacja pokazuje:
✓ Extension installed: rentgen@internet-czas-dzialac.pl
✓ Firefox ESR running in headless mode
✓ Xvfb running on display :99

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 17:59:52 +02:00
165df535da chore: aktualizacja .gitignore i package-lock.json
- Dodano .claude do .gitignore (katalog Claude Code)
- Aktualizacja package-lock.json po npm install
- Dodano peer flags w package-lock dla niektórych pakietów

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 17:41:03 +02:00
a06bb028a7 feat(docker): dodaj runtime stage z web-ext run
- Dodano nowy stage 'runtime' w Dockerfile
- Instalacja Firefox ESR i Xvfb dla headless execution
- Automatyczne uruchomienie web-ext run z Xvfb
- Dodano usługę rentgen_run w compose.yml
- Zaktualizowana dokumentacja z przykładami użycia

Możliwe użycie:
- docker build --target runtime -t rentgen-run .
- docker run --rm -it rentgen-run
- docker compose up rentgen_run

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 17:40:45 +02:00
d7dc55e94e [empty commit] testing 2025-10-25 17:13:39 +02:00
81200e96e5 empty test commit 2025-10-25 14:24:53 +02:00
f41ccda54d feat(docker): dodaj opcjonalne uruchomienie testów podczas buildu
Dodano build arg RUN_TESTS (domyślnie false), który pozwala na
warunkowe uruchomienie quality checks (typecheck + lint) podczas
budowania obrazu Docker.

Użycie:
- Bez testów: docker build -t rentgen .
- Z testami: docker build --build-arg RUN_TESTS=true -t rentgen .

Testy dodają ~10 sekund do czasu buildu.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 14:16:16 +02:00
46cd00253c fix(typecheck): naprawa błędów TypeScript
- Zmiana typu zwracanego w use-survey.ts z Survey.ReactSurveyModel na Survey.Model
- Dodanie brakującej prop refreshToken w StolenDataCluster

Typecheck teraz przechodzi bez błędów.
2025-10-25 14:16:16 +02:00
5edebd4433 Dodaj wsparcie Docker i dokumentację Claude Code
- Dodano Dockerfile z multi-stage build (artifacts + dev environment)
- Dodano .dockerignore dla optymalizacji budowania
- Dodano CLAUDE.md z dokumentacją architektury i workflow dla Claude Code
2025-10-25 14:16:16 +02:00
cf94d45ee1 Bump version to 0.2.1 2025-10-24 18:04:42 +02:00
f1b1b6e720 Merge pull request 'chore(package.json): początek dodawania abstrakcji w build-time' (#125) from refactor/build_time_abstraction into develop
Reviewed-on: #125
2025-09-22 12:10:18 +02:00
am0
e1d9b8c874 feat(lib/browser-api): dodaj warstwę abstrakcji Browser API dla wsparcia Chrome i Firefox
Wprowadza infrastrukturę umożliwiającą budowanie rozszerzenia dla Chrome i Firefox z jednej bazy kodu. Mapuje różnice w API między przeglądarkami na ujednolicone interfejsy.

ZMIANY:
* lib/browser-api/types.ts - typy oparte na analizie rzeczywistego użycia API w kodzie
* lib/browser-api/firefox.ts - adapter mapujący browser.* na BrowserAPI
* lib/browser-api/chrome.ts - adapter mapujący chrome.* na BrowserAPI
* lib/browser-api/index.ts - build-time selection adaptera na podstawie TARGET

KLUCZOWE RÓŻNICE OBSŁUŻONE:
- Firefox: browser.browserAction.* vs Chrome: chrome.action.*
- Firefox: browser.tabs.* vs Chrome: chrome.tabs.*
- Firefox: browser.cookies.* vs Chrome: chrome.cookies.*
- Firefox: browser.webRequest.* vs Chrome: chrome.webRequest.*

TYPY OPARTE NA FAKTYCZNYM UŻYCIU:
Przeanalizowano 4 pliki używające browser API:
- memory.ts: badge, webRequest, cookies, extension API
- toolbar.tsx: tabs.query, tabs.onUpdated, windows.WINDOW_ID_CURRENT
- tab-dropdown.tsx: tabs.query
- util.ts: tabs.query

STATUS: Preparatory change - istniejący kod pozostaje niezmieniony.
Kolejne commity będą refaktorować pliki do używania nowej abstrakcji.

TARGET: Umożliwienie
> rentgen@0.1.10 build:firefox
> TARGET=firefox node esbuild.config.js

Add-on was built i
> rentgen@0.1.10 build:chrome
> TARGET=chrome node esbuild.config.js

Add-on was built
2025-09-08 10:50:09 +02:00
am0
95bb5248ef fix(ikony png): W repo będziemy trzymać tylko oryginalne ikony svg, a skalować i konwertować przy buildzie 2025-09-07 15:38:51 +02:00
d167a2138c style(icons): konwersja ikon svg na png kompatybilne z Chrome
Wygenerowanie wersji PNG (16px, 20px i 24px) wszystkich ikon SVG przy użyciu komendy Inkscape z wiersza poleceń

Główna ikona wtyczki (dla manifest.json) Chrome oczekuje konkretnych rozmiarów, stadndardowych dla Chrome (16, 32, 48, 128), ale ikony interfejsu (używane wewnątrz stron rozszerzenia) Chrome mogą mieć dowolny rozmiar, ponieważ to zwykłe obrazy w HTML. Ustawiłem je zgodnie z naszymi obecnymi rozmiarami (16, 20, 24px)

użyta komenda for svg in assets/icons/*.svg; do basename=$(basename "$svg" .svg); for size in 16 20 24; do inkscape --export-type=png --export-width=$size --export-height=$size --export-background-opacity=0 "$svg" --export-filename="assets/icons/${basename}-${size}.png"; done; done
2025-08-29 11:04:16 +02:00
am0
a617d82716 chore(package.json): początek dodawania abstrakcji w build-time
- wprowadzenie rozróżnienia w buildach dla firefox i chrome
- dodanie @types/chrome do rozpoznania przez typescript
2025-08-11 17:58:30 +02:00
546233e093 Prawo telekomunikacyjne → Prawo Komunikacji Elektronicznej
Dzięki @kayo77@pol.social za sygnał, aby to poprawić
2025-07-19 15:31:46 +02:00
ea70d26a38 Update 'README.md' 2023-09-26 23:05:42 +02:00
1680026bc4 Typos 2023-06-21 17:14:40 +02:00
d5a8172759 Fix typos 2023-06-21 17:14:07 +02:00
039698264a Bardziej podejrzane domeny dawaj na początku w toolbarze 2023-03-22 15:51:07 +01:00
7cf1b95461 Update 'README.md' 2023-02-17 10:37:40 +01:00
799f17eac8 Add mozilla addons link 2023-02-14 20:34:21 +01:00
5c96a7f4cb Bump version 0.1.10 2022-09-25 14:04:51 +02:00
32107f0ebc Dodanie explainerów dot. cookies na podstawie komentarzy, od których
odwołał się WSA w uzasadnieniu wyroku w sprawie z iSecure
2022-09-25 14:03:06 +02:00