Giter Site home page Giter Site logo

foxygestures's Introduction

Foxy Gestures

A mouse gestures extension for Firefox. This project was started as a web extensions alternative to FireGestures. Unfortunately, FireGestures will stop working when XUL/XPCOM add-ons are fully deprecated in Firefox 57.

Feature Requests

FireGestures is a very mature plugin with a huge number of features. Although I used it for many years, I probably didn't use it in the exact same way as you. Some features maybe have been unintentionally ignored or forgotten by me. I am slowly implementing features in Foxy Gestures as my time allows. This wiki article contains a list of supported commands vs FireGestures. The list is not exhaustive and you can request features using GitHub issues even if they are not currently planned.

Limitations

As a web extension, this add-on will never be as powerful as FireGestures. This extension does not integrate into about:home, about:newtab, view-source:, moz-extension:, etc. Nor will it work on addons.mozilla.com, since web extensions are forbidden from interacting with the add-on store.

More importantly, the mouse gestures will not work until the document body of the website you are visiting has parsed. In other words, the DOM must be at least partially parsed but content does not have to be loaded. This limitation also applies to frames within the website. This is an inherent limitation of web extensions at the moment, because there is no API to get mouse events from browser chrome. In practice this is rarely an issue as mouse events are typically available very quickly.

Working Principle

This extension hooks into DOM mouse events. However, each frame in a website is a separate DOM often with a separate origin. In a naïve implementation the mouse gesture would stop tracking whenever the mouse passed over an iframe.

The solution is to have the web extension inject mouseEvents.js into every frame. Each time the script loads it will determine if it has been framed. If the script has been framed, it will establish communication with its parent frame (also running mouseEvents.js) via postMessage(). Nested instances of the script will relay mouse events up the hierarchy. As the message bubbles up the hierarchy, each script applies a coordinate offset based on the position of the nested <frame> or <iframe> element. In this way, the top-most script sees all mouse events in the coordinate space of the top-most DOM. mouseEvents.js also maintains a small amount of state. To keep all instances of the script in sync, this state is replicated by passing messages down the hierarchy. Ultimately, this setup provides the extension with a seamless view of mouse events across all frames upon which to build the rest of the extension.

It is worth noting that DOM references cannot be shared via post message. As a result, a reference to the element under the mouse gesture is only available in mouseEvents.js in the frame which generated the event. To support features that need information about the element, attributes are collected a priori and bundled with mouse event data for mouse up/down events. To support situations that require access to the live DOM, mouseEvents.js assigns a unique identifier to each frame in which it loads. Messages may be addressed to a specific frame using the unique frame ID.

OSX/Linux Gesture Button Limitation

Note: this issue is resolved from FF58 and FG1.1.0 due to API changes landing in Firefox. In OSX and Linux, the context menu is shown on mouse down. (Context menu on mouse up is the default for Windows.) When FireGestures is installed on OSX/Linux, it changes the context menu to be shown on mouse up. Web extensions cannot replicate this functionality. Due to the issue described in #4 right-button gestures work poorly in OSX/Linux.

foxygestures's People

Contributors

c01o avatar dependabot[bot] avatar gnehs avatar gnqg avatar kms70847 avatar marklieberman avatar mtd91429 avatar pmorch avatar rubcap avatar yfdyh000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foxygestures's Issues

Setup a unit testing framework and write tests

It looks like I need 3 test suites - content, background, and options. Then I need to mock the web extension APIs. Lastly, I may have to refactor some code to make it more accessible to tests.

Duplicate gesture

If I try to assign a gesture which is already used for another action the Foxy's setting page freezes

Add a 'real' PageUp/PageDown gesture

The 'PageDown' gesture now increments the page number in the URL.
Very neat and useful, but not what I was expecting when I read 'PageDown'.
'NextPage' could be a better naming for this feature?

On the other hand, a real 'PageDown' gesture would enable us to scroll the page to the next viewport, much like when you hit the space bar on a website. FireGestures had this feature and I used it a lot.

The same goes for 'PageUp' of course ...

Xenforo text editor doesn't work when foxygestures is active

Since Nightly from June 5th, the text editor of Xenforo discussion boards doesn't load when foxygestures is activated. It loads however if DevTools are open.
When it's not loading the console throws the following TypeError error: 'this.$editor[0] is undefined'.

Foxygestures version 1.02 as distributed on AMO.

Fix save media now command for extensionless links

In the snippet below the type attribute can be used to infer a suitable extension for the source attribute.

<video loop="loop" controls="controls">
  <source src="/image/248216" type="video/webm">
</video>

Scrolling mouse gestures?

Is there a way to set scrolling mouse gestures without the wheel? I wanted to set them like fire gestures, single up and single down, but I found only options that use the wheel. My mouse doesn't have a wheel, so I can't use any of those options.

How to create gestures?

Hello! I used to use firegestures but switched to this one. Can I make gestures for next tab, previous tab, new blank window, new blank tab in foreground, close all other tabs, etc? Like firegestures, I guess. Thank you!

Mouse gesture issues

Hi! I saw your post on reddit.com/r/firefox about moving over to Foxy Gestures from FireGestures. I used FireGestures (and am using Foxy Gestures) mostly for the mouse gestures, but I've noticed a few issues.

I have right-click+scroll up set to Open New Tab. I've noticed that most of the time, it will open a new tab, but it also opens the context menu on the new tab. This means that if I start typing an address/search right away, it triggers something in the context menu, and I end up getting a random page or changing settings.

My right-click+scroll down is set to Reload Page. This works fine, but I've noticed that many times if I simply scroll down a webpage (without mouse input), it will reload. I'm not sure why this is happening without mouse input.

Is there someway to save an input log to attach to this issue?

Thanks! I really appreciate you creating a WebExtension for this purpose!

Add custom mouse gestures

Is possible add custom gestures like "Open image in a new tab" or something like that, or you will provide in the future more gestures like this?
Thanks for create a gestures WE alternative extension.

Always active gesture state

Sometimes and/or on some pages, the gesture state is always active and registering gestures and thus makes the feature unusable.

New command: Reload (bypass cache)

Hi!
Feature request: add the ability to create a gesture for Reload (override cache) command.
Possbile bug: using the Save media now command, the downloaded files doesn't show up in Firefox, the indicator doesn't glow up, but the file is downloaded properly.

[Feature Suggestion] Duplicate Tab with history

Would it be possible to implement a duplicate tab that retains the 'back' session history from the original tab? FF57 has a native duplicate tab support in tab context menu that retains history. Cheers.

Support for status display

FireGestures can display a status text in the lower left corner during and after a gesture. I'd like to have a similar component to provide feedback.

Does not save changes in FF 56.0b2

Extension does not seem to save settings made to built-in gestures. I tried changing New Tab to Down gesture, and nothing was saved.

Someone else reported the same bug here.

Move settings to sync storage

Hi,
the application settings could be synced online, by storing the settings also in storage.sync.

Could it be a option?

It would be very useful to sync the gesture options in multiple devices.

Thanks

Support for mouse wheel gestures

Hi, do you plan/is it possible to have mouse wheel gestures like in firegestures?

Specifically I'm thinking of the Popup options firegestures had, for things like history and recently closed tabs list (may be better to track popups as a separate issue?)

Not sure if the latter is possible in web extensions, I might have a play around and test if it's possible.

Add locales

Hi,

First of all, great work on this FireGestures replacement!
The options page is neat and an example of how it should be done!
Thank you for all the work already done.

Please let me know if I can help you translate your add-on to Dutch.

Incorrect behavior of Open Link In New Tab gesture

I haven't tested with other gestures, but at least Open In New Tab appears to not work in certain contexts.

Here's a video of www.deviantart.com for illustration:

  • First I used the New Tab gesture on an image link which works as long as the mouse cursor does not leave that image. However, it turns out this is just the default middle-click open action (as I'm using middle mouse for gestures).
  • When leaving the image link with the mouse cursor nothing at all happens.
  • Finally I used it on a text link which works fine.

I've had similar issues on other websites, for example with buttons. It seems the issues show up when the link under the mouse cursor isn't a traditional link. Is there anything that can be done about that?

PS: The popup in the bottom right shows that the correct gesture is recognized; it isn't executed though.

I'm using FF 54.0.1 on Linux and FoxyGestures 1.0.6 directly from AMO.

Improve numeric increment

Hi,
it would be possible to match also url link sect219.html, where the number is before a dot?

Thanks

"Save Media As" doesn't remember directory by domain

When I use the context menu to save for example an image, then firefox remembers the target directory for media from the same domain and starts navigation for the next image from the same domain in that directory.
When I use the gesture the "Save as" dialog always starts with the "Downloads" directory and doesn't remember the last directory.

Provide a way to call the inbuilt gestures from user scripts

I would like to , for instance, be able to have a custom rule based media saving user script, which finally falls back to the default behavior of "save media as" gesture in case my rules did not satisfy.

This is just a simple example, the possibilities are endless.

Suppressing context menu in OSX

The context menu is not suppressed in OSX because the context menu event fires on mouse down.

On Windows, it fires on mouse up. This affords me the ability to suppress the contextmenu event if a gesture has started.

This is a problem on OSX because at the time when contextmenu event is fired I do not know if a gestures has started. If I choose to preventDefault() the context menu, I cannot trigger the contextmenu event again using pure JavaScript or WE APIs.

The only workaround I can think of is a modifier key to either enable or disable gestures, and then only suppress the context menu when the modifier key is pressed.

Support for user scripts

I'd like to support gesture bindings for user scripts. I'm not sure how to do this yet. It may require unsafe-eval permissions.

Make gestures work on internal pages

And if not possible with current API bother Mozilla long enough to make it possible

EDIT: seems like gestures get disabled also on addons website, just like in chromium...
if I wanted to use chromium I'd just use chromium, right?

[BUG] Restore backed up settings makes the addon "hang"

Versions: FF 56.0b10 (64-bit) and FG 1.0.8beta4

I had to do a profile refresh a couple of days ago so I made backups of all my extensions, and making backups work just fine, but restoring the backup makes the addon "hang" - as in, FF is fine, but on the addon page where you restore the backed up settings the addon just hangs. FG seems to work fine otherwise, but it will not import the settings.

regards, Brian L

EDIT: Loving FG - luckily I only had like 3 gestures to change to my liking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.