Prepare target='_blank'
This commit is contained in:
parent
728b0cb35f
commit
93f9e8219e
1 changed files with 5 additions and 5 deletions
|
@ -63,16 +63,16 @@ export default class FollowSlaveUseCase {
|
|||
|
||||
if (hint instanceof LinkHint) {
|
||||
let url = hint.getLink();
|
||||
// ignore taget='_blank'
|
||||
if (!newTab && hint.getLinkTarget() === '_blank') {
|
||||
hint.click();
|
||||
return;
|
||||
let openNewTab = newTab;
|
||||
// Open link by background script in order to prevent a popup block
|
||||
if (hint.getLinkTarget() === '_blank') {
|
||||
openNewTab = true;
|
||||
}
|
||||
// eslint-disable-next-line no-script-url
|
||||
if (!url || url === '#' || url.toLowerCase().startsWith('javascript:')) {
|
||||
return;
|
||||
}
|
||||
await this.tabsClient.openUrl(url, newTab, background);
|
||||
await this.tabsClient.openUrl(url, openNewTab, background);
|
||||
} else if (hint instanceof InputHint) {
|
||||
hint.activate();
|
||||
}
|
||||
|
|
Reference in a new issue