• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    Can I ignore target attribute?

    Opera for Windows
    5
    8
    3429
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • veggen
      veggen last edited by

      Is there a way in new Operas to ignore the target attribute of links (to prevent opening in new tabs)?

      Reply Quote 0
        1 Reply Last reply
      • elrice
        elrice last edited by

        I don't think userCSS or userJS available as yet, but you might be able should be able to do with js as a bookmarklet...

        Start at Userscripts.org but I think there are a number of such sources....

        Reply Quote 0
          1 Reply Last reply
        • veggen
          veggen last edited by

          I've ended up installing Violent monkey extension and making my own script for this. In case someone cares, the source is:

          // ==UserScript==
          // @name Ignore link target
          // @author veggen
          // @description Ignores the target attribute on links.
          // @version 0.1
          // @include *
          // ==/UserScript==
          
          [].forEach.call(
            document.querySelectorAll('a[target]'), 
            function(targettedLink){
              targettedLink.removeAttribute("target");
            }
          );
          
          Reply Quote 0
            1 Reply Last reply
          • A Former User
            A Former User last edited by

            Originally posted by veggen:

            I've ended up installing Violent monkey extension and making my own script for this. In case someone cares, the source is:

            thank you for this
            🆙

            Reply Quote 0
              1 Reply Last reply
            • A Former User
              A Former User last edited by

              @veggen
              I think it stopped working today
              When I want to download photo from facebook, it opens new empty tab
              It wans't like that before

              I take that back
              It works fine again
              honestly, don't know what happened
              for some reason some of the scripts and extensions stopped working (your script, facebook redirect fixer extension etc)
              but everything seems fine now

              Reply Quote 0
                1 Reply Last reply
              • frenzie
                frenzie last edited by

                What's the difference between TamperMonkey and ViolentMonkey?

                Reply Quote 0
                  1 Reply Last reply
                • missingno
                  missingno last edited by

                  Don't tamper with a violent monkey!

                  Eh ... what was the question?

                  Reply Quote 0
                    1 Reply Last reply
                  • frenzie
                    frenzie last edited by

                    Never mind. They're just script managers. 😛

                    Reply Quote 0
                      1 Reply Last reply
                    • First post
                      Last post

                    Computer browsers

                    • Opera for Windows
                    • Opera for Mac
                    • Opera for Linux
                    • Opera beta version
                    • Opera USB

                    Mobile browsers

                    • Opera for Android
                    • Opera Mini
                    • Opera Touch
                    • Opera for basic phones

                    • Add-ons
                    • Opera account
                    • Wallpapers
                    • Opera Ads

                    • Help & support
                    • Opera blogs
                    • Opera forums
                    • Dev.Opera

                    • Security
                    • Privacy
                    • Cookies Policy
                    • EULA
                    • Terms of Service

                    • About Opera
                    • Press info
                    • Jobs
                    • Investors
                    • Become a partner
                    • Contact us

                    Follow Opera

                    • Opera - Facebook
                    • Opera - Twitter
                    • Opera - YouTube
                    • Opera - LinkedIn
                    • Opera - Instagram

                    © Opera Software 1995-