Free embeddable widgets built with iframes and an honest credit line
The author describes the design of small embeddable widgets, such as club availability views, court-cost calculators, and data charts, that third-party sites can place on their pages. A loader script finds placeholder elements and creates iframes pointing to dedicated embed routes, with configuration options taken from data attributes that are validated both in the loader and on the server. Framing is relaxed only for the embed routes, using header rules that exclude them from the site-wide X-Frame-Options and frame-ancestors policy, which is considered acceptable because the public, read-only content holds nothing worth clickjacking. Iframe height is adjusted automatically via postMessage with origin and source checks and clamped bounds, avoiding hand-tuned heights. The post concludes with the principle that an embed providing value to its host can reasonably request attribution, with a visible credit line.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in