DEV Community

杨飞叶
杨飞叶

Posted on

1

A browser extension called "Open New Tab For Developers"

As a developer, I often browse websites like Medium.com and Hacker News, but the links on these sites open in the same tab. After reading an article, I have to navigate back to the main site, which negatively impacts the user experience. Opening links in a new tab would be much better.

Therefore, I created a browser plugin called "Open New Tab."

Why did I have to write a new plugin? Because I searched for and used some existing plugins, but they mostly implemented a general logic. This general logic is simple and indeed works for most websites. However, it is not enough; merely writing general logic does not work for some specific websites. The functionality of this kind of plugin is quite similar to ad-blocking plugins, which need to handle the specific DOM structure of particular websites.

Take Medium, for example. Its <a> tag's href attribute is not a complete URL but a strange path string. The complete URL is actually in the data-href attribute of an ancestor element. So for this site, the better approach is to get the complete URL and then open it in a new tab.

Therefore, the feature of this plugin is that, while it meets the need to open links in new tabs for all regular websites like Google, it also provides special handling for websites that developers frequently visit, such as Medium and Hacker News.

So, a more fitting name for this plugin would actually be: "Open New Tab For Developers."

tutor:https://www.bilibili.com/video/BV1hrpMe4E6x/
GitHub:https://github.com/cunzaizhuyi/open-new-tab-extension

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay