This method allows web developers to read back the ContextAttributes consumed by the platform and compare them to what were requested. Shipping this method will allow lining up with WebGL's homonymous method. [1]




Specification link

Specification being incubated in a Community Group

Status in Chromium


In developer trial (Behind a flag) (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Positive
  • No signal
  • No signals



Users provide ContextAttributes on context creation, e.g. let ctx = canvas.getContext("2d", {alpha : false}); this method lets the user read back the actual parameters as the platform consumed them: let alphaValue = ctx.getContextAttributes().alpha; (note that specs in flight add more parameters). Issue trackers for implementation in Firefox and Webkit:

Last updated on 2021-12-13