Plug-ins are extra programs that extend what a browser can do. In the past, browsers needed plug-ins to play videos, run games, or show PDFs. Today, most of those features are built directly into browsers.
Why Plug-ins Are No Longer Common
Years ago, browsers were very basic. They could only show text and images. To play videos, run animations, or show interactive content, you needed plug-ins like Flash, Java, or Silverlight.
Today, modern browsers have built-in support for:
- Video and audio (using the <video> and <audio> tags)
- Graphics and animations (using Canvas and SVG)
- PDF viewing (directly in the browser)
- Interactive 3D graphics (using WebGL)
Plug-ins like Flash and Java are no longer supported. You should avoid using them for new projects.
The <object> Element
The <object> element is still supported in all browsers. It was designed to embed plug-ins, but it can also embed images, HTML pages, PDFs, and other resources.
Here is how to embed an image using <object>:
Here is how to embed an external HTML page inside another HTML page:
Here is how to embed a PDF file:
The <embed> Element
The <embed> element is also supported in all major browsers. It is similar to <object>, but simpler. It does not have a closing tag and cannot contain alternative text.
Here is how to embed an image using <embed>:
Here is how to embed an external HTML page using <embed>:
<object> vs <embed>: Which One to Use?
Both elements do similar things. Here are the main differences:
| Feature | <object> | <embed> |
|---|---|---|
| Closing tag | Has a closing tag (</object>)
| No closing tag (self-closing) |
| Alternative content | Can show content inside if the resource fails | Cannot show alternative content |
| HTML standard | Was in HTML4, still in HTML5 | Was not in HTML4, added in HTML5 |
| Best for | PDFs, external pages, older plug-ins | Simple embeds like images and videos |
| Old Technology | Modern Replacement |
|---|---|
| Flash videos | <video> with MP4 format
|
| Flash animations | CSS animations or Canvas / SVG |
| Java applets | JavaScript + Canvas or WebAssembly |
| Silverlight | JavaScript + HTML5 |
| PDF viewers (external) | <object> or browser built-in PDF viewer
|
Real-World Uses Today
Although plug-ins are mostly obsolete, you might still encounter these use cases:
- PDF viewing – Some websites use
<object>to embed PDF files directly on the page - Legacy systems – Old corporate websites might still use Flash or Java (these are being phased out)
- Browser games – Some older browser games require Flash (most have been rewritten in HTML5)
Quick Summary
- Plug-ins extend browser functionality but are mostly obsolete.
- Flash, Java applets, and ActiveX controls are no longer supported in modern browsers.
- Use
<object>or<embed>only for specific cases like PDF embedding. <object>has a closing tag and can show alternative content.<embed>is self-closing and simpler.- Modern HTML features like
<video>,<audio>, Canvas, and SVG replace most plug-in functions.
What Just Happened? Let Me Explain
- Years ago, browsers were very limited. To watch a video, you needed Flash. To play a game, you needed Java. These were external plug-ins you had to install.
- Today, browsers can do all these things without plug-ins. This is faster, more secure, and easier for users.
- The
<object>and<embed>elements are from that older era. They are still supported, but you rarely need them. - If you need to show a PDF, use
<object>. If you need to show an external HTML page, consider using<iframe>instead. It is more standard. - For new projects, avoid plug-ins entirely. Use modern HTML, CSS, and JavaScript.
<iframe> embed code that YouTube provides. If you need to show a PDF, <object> works well. For everything else, use standard HTML tags.
Plug-ins Reference
| Element | Description | Closing Tag |
|---|---|---|
<object>
| Defines an embedded object (image, PDF, HTML, plug-in) | Yes (</object>)
|
<embed>
| Defines an embedded object (simpler than object) | No (self-closing) |