Prevent target="_blank" #810
-
Is it possible to open href that has target="_blank" without opening browser? |
Beta Was this translation helpful? Give feedback.
Answered by
ValeryVerkhoturov
Oct 6, 2024
Replies: 2 comments 2 replies
-
I solved it with injector const observer = new MutationObserver(() => {
removeTargetBlank();
});
function removeTargetBlank() {
document.querySelectorAll('a[target="_blank"]').forEach(link => {
link.removeAttribute('target');
});
}
const config = {
childList: true,
subtree: true
};
observer.observe(document.body, config); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ValeryVerkhoturov
-
Hi! I saw your solution and tried to use it by saving it as a .js file and injecting it with Pake's --inject, but it didn’t work for me. Could you explain how you used this code? Thanks! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved it with injector