• 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

    First extension

    Opera add-ons
    2
    3
    660
    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.
    • k0ngify
      k0ngify last edited by

      Hi!

      I'm trying to create my first extension which allows me to toggle automatic down scrolling with a keyboard shortcut.
      I already managed to make an extension which does something when I press the key combination, but I don't know how to control the scrolling process. Which API do I use? I already looked through the APIs but couldn't find the right one.

      If someone knows, please tell me. 😃

      Regards

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

        Extension is basically javascript - search for suitable javascript sample and include that into your extension.

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

          First of all, thanks for your answer!

          The method I want to use would be the window.scrollBy(x,y) method, but I'm still having trouble implementing it.

          My background script code:

          chrome.commands.onCommand.addListener(function ScrollDown(command){ if(command == "scroll") {
          window.scrollBy(0,150);
          alert("You tried to scroll! :)"); }})

          The alert works just fine when pressing the key combination, but it won't scroll down.

          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-