【发布时间】:2023-02-20 01:47:19
【问题描述】:
我制作了一个带有一些链接的 Chrome 扩展程序,但是当我单击链接时,它们没有打开预期的站点。我需要单击链接时它会打开一个带有链接的新选项卡,就像超链接一样https://www.google.com/它应该做什么:
- 打开一个新标签
- 在新标签页中,打开链接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>
【问题讨论】:
-
链接是否根本不起作用(如 404 错误)?或者它只是不在新选项卡中打开。因为要在新选项卡中打开链接,请将
target="_blank"设置为链接的属性。 -
不打开新标签
-
好的,你能给个样品吗?
-
这回答了你的问题了吗? How to open link in a new tab in HTML?
标签: html google-chrome-extension