Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Two ways to embed a browser app: live tools and portable results

I build BK Apps, a collection of browser-based document tools and website widgets. One design decision mattered more than the number of widgets: embedding an interactive tool and sharing a finished result are different jobs. Consider a fictional community event. The organizer wants to publish an agenda. Visitors should read the schedule, while the organizer needs an editor to arrange sessions.…

Two primary approaches exist when embedding interactive tools and sharing final outcomes in browser-based applications: live tools and portable results. The choice between these options depends on the intended use case. For instance, in a community event scenario, the organizer might need to edit an agenda, while attendees simply need to view the schedule.

To embed a live editor, a developer can use an iframe. The iframe source specifies the URL of the application, such as "https://apps.burakkaraca.com.tr/en/apps/faq-widget/?embed=tool". This setup allows the iframe to load only when needed, enhancing page performance. The "lazy" attribute defers offscreen work, and the "no-referrer" value prevents the transmission of the user's referrer information.

A simple border and width styling help integrate the iframe with the parent page. Permissions like clipboard writing are granted for copy actions, but not for reading. The parent site’s own permissions policy can further restrict access.

On the other hand, sharing a finished result typically involves a portable URL containing a JSON document. This document is embedded in the URL fragment, meaning it does not affect the initial HTTP request. However, anyone who receives the full link can view its content, so sensitive information should not be shared this way. The result link is essentially a snapshot of the current state, and editing the original draft will not automatically update every shared result link.

Provide clear labels to distinguish between editable tools and published results. Accessibility testing is crucial for both types of embeds, ensuring proper keyboard navigation, visible focus, understandable content, and effective reading order. While an iframe can facilitate integration, it does not guarantee improved SEO. Host pages should provide meaningful context, and attributing the source of an embedded widget is not necessary.

The FAQ application’s "Embed on website" option makes it easy to experiment with both embedding styles. Note that BK Apps is a personal project, and the community event example is purely illustrative.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Why Can't My App Connect to My Database?

A beginner's guide to the 4 checks on AWS The big idea first When your app connects to a database, the connection has to pass 4 checks, one after another . If any one fails, the connection fails.

  • Security Group blocks incoming traffic by default
  • PostgreSQL must listen for external connections
  • pghba.conf grants specific user access

Why Simple Pages Load Faster: A Speed Checklist for Small Business Sites

Most small business websites are slower than they need to be. When we look at a slow site for a local company, the cause is rarely exotic.

  • Small business sites often load slower due to large images, plugins, and heavy themes.
  • Speed impacts local businesses' ability to engage visitors seeking services.
  • Improvements include image compression, plugin audit, theme replacement, and reliable hosting.

Enforce the baseline Pod Security Standard on a namespace (CKS)

Enforce the baseline Pod Security Standard on a namespace (CKS) Lesson four of the CKS series: Pod Security Standards. One of the pods in our namespace can read the logs of every other pod on its…

  • Enforce Pod Security Standard Baseline on namespace
  • Label namespace with pod-security.kubernetes.io/enforce
  • Delete node-inspector pod to save failure event

More from Friday 9 October →