stage25-ghost-payment-widget.js
TEXT FILE490 B · Public source code for developers, search crawlers and AI agents
1function stage25Widget(url) {
2 const u = new URL(url);
3 if (u.origin !== 'https://example.org' || u.pathname !== '/donate' || u.search || u.hash || u.username || u.password) throw Error('Unapproved destination');
4 return u.href;
5}
6if (typeof module !== 'undefined') {
7 const assert = require('node:assert/strict');
8 assert.equal(stage25Widget('https://example.org/donate'), 'https://example.org/donate');
9 assert.throws(() => stage25Widget('https://example.org.evil.test/donate'));
10}Read-only source · Select a line number to link directly · Raw download above
