-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
supportive: chromeSupportive from ChromeSupportive from Chromesupportive: firefoxSupportive from FirefoxSupportive from Firefoxsupportive: safariSupportive from SafariSupportive from Safari
Description
Most WebExtension APIs hang when they receive overly long strings. In a typical page, when JS calls a Web-exposed API, at worst it can hang a singe web frame or a tab. Extensions run with less isolation and in practice can hang the entire browser. This is a blanket issue where I'll index all WebExtension APIs and manifest fields and current browser behavior.
API Analysis
Action Title
String sources
action.setTitle()(user-visible, dynamic)action.default_titlemanifest key (user-visible, static, localizable)browser_action.default_titlemanifest key (user-visible, static, localizable)
Alarm Name #422
String sources
alarms.create({name})- (non-user-visible, dynamic)- Alarm name length limit - No length limits in any browser, every browser can hang.
- Alarm count limit
- Chromium 117 (PSA, commit) limits each extension to 500 alarms, throwing an error
'An extension cannot have more than 500 active alarms.'if extension attempts to create 501-th alarm. - Firefox does not have a limit, tracking bug
- Chromium 117 (PSA, commit) limits each extension to 500 alarms, throwing an error
alarms.clear(name)alarms.get(name)
Next Action
Collect data from Chrome 144 Histogram, discuss during meeting on Jan 29, 2026.
Paths in extensions
Extension icon path length
action.setIcon({path})
Extension popup path length
action.setPopup({popup})browser_action.setPopup({popup})
Extension badge text #960
action.setBadgeText({text})
Chrome issue: https://issues.chromium.org/issues/491158086
Chrome Histogram CL: https://chromium-review.googlesource.com/c/chromium/src/+/7651914
Process to introduce string length limit
Tentative steps to introduce a limit for an API:
- Identify parameter which does not have a limit yet. Fill out Column 1.
For example, "alarm name". - Identify every API method and/or manifest key where this parameter may occur as an input (source of long inputs for browser). Fill out Column 2.
For example, for "alarm name", sources can bealarms.create({name})alarms.clear(name)alarms.get(name). While some other APIs also deal with alarm names (e.g.,alarm.getAll()would still be overloaded by long alarm names), they are actually outputs (sinks of long names). - Figure out current behavior in browsers.
Try to pass long inputs for each method and/or manifest key identified in step 2 and record outcome. Repeat with a few browsers, if technically possible and time allows. - Introduce a study (a histogram) to track usage in one browser.
Identify appropriate "buckets" of input lengths. Preferably, list them in the table above and/or dedicated issue under WECG repository. Also, discuss potential future behaviors for dealing with long inputs (silently ignore, ignore with a warning, or throw an error). - Wait for study results
Wait a few "milestones" for histogram code to reach stable releases, then a few more to collect reasonably representative data. - Finalize the proper limit and behavior for long inputs.
Discuss study results in WECG tracker or a meeting. - Add WPT cases for he limit and implement the new behavior in at least one browser.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
supportive: chromeSupportive from ChromeSupportive from Chromesupportive: firefoxSupportive from FirefoxSupportive from Firefoxsupportive: safariSupportive from SafariSupportive from Safari