New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

iframe-touch-relay

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iframe-touch-relay - npm Package Compare versions

Comparing version

to
0.0.7

@@ -0,4 +1,9 @@

interface AttachRelayOptions {
debug: boolean;
decodeCoordinates: (element: HTMLElement, x: number, y: number) => { clientX: number, clientY: number }
}
export function attachTouchRelay(): void;
export function detachTouchRelay(): void;
export function attachRelayToPage(my_zones: any): void;
export function attachRelayToPage(my_zones: any, options?: Partial<AttachRelayOptions>): void;
export function detachRelayToPage(): void;

@@ -192,2 +192,3 @@

export function attachTouchRelay(options) {
options = options || {};
debug = options.debug || false;

@@ -203,15 +204,18 @@ decodeCoordinatesWorker = options.decodeCoordinates || decodeCoordinates;

let overlay;
export function attachRelayToPage(my_zones) {
const box = document.createElement("div");
box.style.position = "fixed";
box.style.width = "100%";
box.style.height = "100%";
box.style.zIndex = "1000";
document.body.insertBefore(box, document.body.children[0]);
box.addEventListener("touchstart", handleStart, false);
box.addEventListener("touchend", handleEnd, false);
box.addEventListener("touchcancel", handleCancel, false);
box.addEventListener("touchmove", handleMove, false);
zones = my_zones;
overlay = box;
export function attachRelayToPage(my_zones, options) {
options = options || {};
debug = options.debug || false;
decodeCoordinatesWorker = options.decodeCoordinates || decodeCoordinates;
const box = document.createElement("div");
box.style.position = "fixed";
box.style.width = "100%";
box.style.height = "100%";
box.style.zIndex = "1000";
document.body.insertBefore(box, document.body.children[0]);
box.addEventListener("touchstart", handleStart, false);
box.addEventListener("touchend", handleEnd, false);
box.addEventListener("touchcancel", handleCancel, false);
box.addEventListener("touchmove", handleMove, false);
zones = my_zones;
overlay = box;
}

@@ -218,0 +222,0 @@

{
"name": "iframe-touch-relay",
"version": "0.0.6",
"version": "0.0.7",
"description": "Relays touch events inside iframe, to support multi-touch on pages with multiple iframes",

@@ -5,0 +5,0 @@ "main": "index.js",