9 lines
282 B
JavaScript
9 lines
282 B
JavaScript
|
document.onreadystatechange = function () {
|
||
|
document.querySelectorAll("a").forEach((element) => {
|
||
|
let href = element.href;
|
||
|
if(href.indexOf(location.hostname) === -1){
|
||
|
console.log(href);
|
||
|
element.target = "_blank";
|
||
|
}
|
||
|
})
|
||
|
}
|