在chrome扩展中创建超链接



我做了一个Chrome扩展与一些链接,但当我点击链接,他们不打开预期的网站。我需要当一个链接被点击它打开一个新的选项卡与链接,就像如果一个超链接与https://www.google.com/它应该做什么:

  1. 打开新选项卡
  2. 在新选项卡中,打开链接https://www.google.com/
<html xmlns="http://www.w3.org/1999/html">
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Selenideium Element Inspector</h2>
<div>
<p>A handy tool to log attributes and Selenide, Selenium, Cypress, Playwright, TestCafe, Squish locators of the clicked element.
You can save dozens of minutes each day by using this plugin.</p>
<p>
Usage:<br>
</p>
<ol>
<li>Install the plugin</li>
<li>Open a page</li>
<li>Open DevTools</li>
<li>Open console</li>
<li>Enable permanent log in the console's settings to prevent clearing the console on page change</li>
<li>Click on an element</li>
<li>Select the most nice-looking selector</li>
<li>Copy-paste it into your favourite IDE</li>
<li>Go to step 6.</li>
</ol>
<p>
Do you have any feedback? Do you miss a feature? Submit it on <a href="https://github.com/mszeles/selenideium-element-inspector/issues">GitHub.</a>
</p>
<p>Created by <a href="https://mszeles.com">Miki Szeles</a>.</p>
<p>Show your support by <a href="https://buymeacoffee.com/mikiszeles">buying a Coffee for me</a> in case this extension makes your work easier</p>
<small>Have fun!</small>
</div>
</body>
</html>

使用target="_blank"属性-

<p>Created by <a href="https://mszeles.com" target="_blank">Miki Szeles</a>.</p>

最新更新