Gestures aren't working on https://addons.mozilla.org/ or any extension pages like https://addons.mozilla.org/en-US/firefox/addon/gesturefy/ It seems to just ignore any gestures.
I also stated this on the mozilla addon page. Addons are denied to inject scripts into the mozilla addons page. (btw I have no idea why..) Same problem as described here: #5
Okay another url, https://upload.wikimedia.org/wikipedia/commons/5/5d/PI_constant.svg gesture doesn't work here :/
Thank you. I completely forgot about svgs, but it should be possible to fix this.
It looks like I was a bit too optimistic about that..
The short conclusion is: it's not or only partially possible without changing the svg.
In detail: Normally I append a container to the websites body which then lies above all the content. This gives me the possibility to draw everywhere on the screen what I want.
For pure not embeded svgs however there is no such thing as a body. The root element is called "svg" and normally does not allow to append any kind of html elements nor does it support the canavas (the api I use for drawing the gesture). Nevertheless for both problems there is kind of a solution.
For the first problem exisits a foreignObject which I scaled to the screen size. Even though this won't work perfectly if the svg is somehow postponed.
let container = document.createElementNS('http://www.w3.org/2000/svg',"foreignObject");
container.setAttribute("width", window.innerWidth);
container.setAttribute("height", window.innerHeight);
container.appendChild(canvas);
Second Problem: Here I created a new HTML document object which then allowed me to create a canvas object, because xml/svg would just create a normal element named canvas without its funcionality.
let canvas = document.implementation.createHTMLDocument().createElement("canvas");
However the area where I can show elements is still limited to the svgs size. So for your example it's a container of 440 x 100 pixes. I could change the sizes to the maximum window size and put the displayed svg elements in a down scaled group. But this would mean that I have to change the svg element, even though it wouldn't be visible untill the user downloads the svg.
Another possibities would be to completely remove/clear the current document object and create a new html document with html, head, body and append the svg element to the body. drawback: when the user wants to save the svg it will then save an html document.
I have to admit, that I like none of the solutions, because in both I have to modify the original svg :|
I think gestures without display in svg is acceptable.
Actually I has disabled all path/action/... display functions. :)
Big news about that, now is sufficient create this boolean string:
privacy.resistFingerprinting.block_mozAddonManager and then set to true.
Now all extensions works on Mozilla websites.
Tip details here:
https://www.ghacks.net/2017/10/27/how-to-enable-firefox-webextensions-on-mozilla-websites/
Closed in an issue clean up process due to the lack of an appropriate or upcoming API.
Most helpful comment
Big news about that, now is sufficient create this boolean string:
privacy.resistFingerprinting.block_mozAddonManager and then set to true.
Now all extensions works on Mozilla websites.
Tip details here:
https://www.ghacks.net/2017/10/27/how-to-enable-firefox-webextensions-on-mozilla-websites/