Skip to main content

Module browser_bypass

Module browser_bypass 

Source
Expand description

Bypass: the person lets the agent driving a browser pane act without asking first, on the site(s) the pane is on, for a time they choose (docs/specs/SPEC_BROWSER_PANE_BYPASS_2026_10_16.md).

A grant lives only here, in memory: srv restarting ends every grant, and the pane’s browser:bypass meta key (srv-only, like browser:attention) only mirrors it for the header strip. Only the person grants one: through the host (/api/v1/host/browser_bypass, the Bypass button) or by answering an agent’s request_bypass banner, which also arrives only through the host. An agent may end its own grant, never start one.

A grant is for one pane (and the popup windows its page opens; a popup pane has its own header and its own grant), one agent (the owner when it was granted), the sites the person was shown, and a time limit. Take over, closing the pane, a change of owner and the time limit end it, and so do IDLE_LIMIT minutes without a Browser call from its agent on the pane: a hung or stopped agent doesn’t keep one alive. While the person has paused the pane (browser_actions), both clocks stand still: the agent can’t call then, so it isn’t going quiet.

Structs§

Grant 🔒
Live 🔒
A grant, and the srv state it was made with: forget’s callers have none of their own, and it still takes the header strip down through it.
Table 🔒

Enums§

Due 🔒
What the watcher of grant id on pane does next.

Constants§

BRANDS 🔒
The wallets and pay apps whose name ends in “Pay”. A page of payment methods lists a row, tab or link for each, and opening one pays nothing. Only these: any other name with “Pay” in it (an unknown brand, “Quick Pay”, “Approve Kakao Pay”) asks, as it always did. Keep in step with BRANDS in click_label.js.
BYPASS_META_KEY 🔒
Block meta key the browser pane’s header reads.
CHOICES_MINUTES 🔒
The durations the person can pick, in minutes. 60 is the default.
COMMANDS 🔒
A description that opens with one of these tells the person to pay.
DEFAULT_MINUTES 🔒
IDLE_LIMIT 🔒
A grant ends after this long without a Browser call from its agent on the pane (touch), with IDLE_REASON. Time the pane spends waiting on the person (a hand-off, a question) doesn’t count: the agent is waiting for them then, not stuck.
IDLE_REASON 🔒
NO_LIMIT 🔒
Stands in for “no limit” on a standing grant’s clock: far enough that no pane outlives it, so the time-limit code needs no second case.
REQUEST_COOLDOWN 🔒
After the person says No to an agent’s request, the agent may not ask again on that pane for this long.
TIME_UP_REASON 🔒

Functions§

active_for 🔒
The live grant on pane for agent, if any. An expired one is dropped here, without waiting for its timer.
active_for_any 🔒
Does pane hold a live grant, whoever’s?
clamp_minutes 🔒
Round asked to one of CHOICES_MINUTES: the nearest one not longer than asked, and never past the longest. None gives the default.
click_is_payment 🔒
Does the committing click what (with the element’s description under its name) spend or move money? is_payment on both, except that a brand’s name (“Kakao Pay”) is not one: a payment-methods page lists dozens, and a click on one opens its settings. Its description still counts when it opens with a command (“Pay $20.00 now”).
cooling_down 🔒
Did the person decline a request on pane too recently for another?
due 🔒
Grant id on pane at now: past its time, or idle since its agent’s last Browser call there. busy: the pane waits on the person, which counts as activity. A paused grant is never due.
end 🔒
End pane’s grant, if it has one, and take the header strip down; with say_why, the strip says why it ended instead (the person who ended it themselves needs no note). Returns whether there was one. how is for the action log: the agent’s own stop is Allowed, the person’s ByUser.
end_if 🔒
end_standing 🔒
End every live grant made from standing row row_id (the row was revoked or changed): each pane’s strip comes down, and the agent’s next call makes a new grant from what the row says now, if it still says anything.
forget 🔒
End pane’s grant for callers that have no AppState: Take over, closing the pane, a new owner. The strip is cleared through the state the grant was made with, so it can’t go on showing a grant that has ended.
grant 🔒
Record a grant on pane for agent over origins, show it in the pane’s header, log it (how: the person’s header button, or their answer to the agent’s request), and end it when its time is up or its agent goes quiet. Replaces any grant the pane had.
grant_made 🔒
grant_standing 🔒
A grant with no time limit, made from the person’s standing row row_id when agent works on a pane showing a site the row names. It ends like any other (Stop, Take over, the pane closing, going idle), and when the row is revoked or changed. After going idle or a changed row the next call makes it again; after the person’s Stop it doesn’t, until they turn it on again (browser_standing::stop_by_person).
grant_watched 🔒
hold_all 🔒
“Pause all agent browsing” was turned on or off: hold every grant’s clock whose pane is paused now, and restart the rest.
hold_clock 🔒
Stop (hold) or restart pane’s grant clocks: the person paused or resumed the pane. The watcher needs no word: it finds the new deadlines when it next wakes, which is never later than they are.
is_brand_pay 🔒
Is name, whole, one of the BRANDS?
is_payment 🔒
Does the committing click what (the approval’s “Click "…"”) spend or move money? Those still ask under bypass (spec §11.2): the cost of a mistake is money, and bulk jobs rarely pay. Matched by word stem (“pay” covers payment, payments, paying), so it errs towards asking.
is_standing 🔒
Is the live grant on pane one made from a standing row?
note_declined 🔒
origins_for 🔒
The sites a grant on pane binds to: the origin of the page it shows (url, as the host reports it), and its site list if it has one.
outside_of 🔒
What what says around the quoted name: (in a frame from https://pay.example.com).
publish 🔒
Write value as the header strip’s browser:bypass.
quoted 🔒
The name in a click’s what (Click "Kakao Pay"): what is between the first and the last quote.
reset_strips 🔒
Clear every pane’s strip. Called when the host registers: a grant never survives srv restarting, and the strip, saved with the pane, must not keep claiming one.
shorten 🔒
An agent asked for minutes while pane already holds its live grant: cut the grant to that when it has longer left, so it lasts what was asked or less. Returns the grant as it is now and the minutes it had left, when it was cut.
strip_value 🔒
The header strip’s copy of a live grant.
table 🔒
touch 🔒
A Browser call from agent on target (a pane, or a popup window, whose grant is its opener’s): it keeps that agent’s grant there alive. Every agent browser call resolves its pane through ui_handlers::target_block_id, which calls this.
watch 🔒
One task per grant ends it on time or when its agent goes quiet. A touch only moves the deadline: the task wakes at the old one, finds the grant still in use, and sleeps until the new one.
without_plans 🔒
name without its plan names (“Pay-as-you-go”, “Pay-per-use”): a pay-as- or pay-per- at the start of a word and the letters, digits, _ and - after it. Done as click_label.js does it, so both judge the same text.