Created
April 2, 2026 12:45
-
-
Save mardr/1dc7472b49d9d13b04e5a28dde3af3f0 to your computer and use it in GitHub Desktop.
KSeF autofill NIP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name KSeF autofill NIP | |
| // @match https://ap.ksef.mf.gov.pl/* | |
| // @run-at document-idle | |
| // ==/UserScript== | |
| const NIP = '1234567890'; // <-- wpisz swój NIP | |
| const tryFill = () => { | |
| const input = document.querySelector('input[formcontrolname="nip"]'); | |
| if (!input) return; | |
| // Angular wymaga symulacji zdarzeń, samo .value= nie wystarczy | |
| const nativeInputValueSetter = Object.getOwnPropertyDescriptor( | |
| window.HTMLInputElement.prototype, 'value' | |
| ).set; | |
| nativeInputValueSetter.call(input, NIP); | |
| input.dispatchEvent(new Event('input', { bubbles: true })); | |
| input.dispatchEvent(new Event('change', { bubbles: true })); | |
| }; | |
| // Poczekaj aż Angular wyrenderuje formularz | |
| setTimeout(tryFill, 1500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment