From 40245cd179ac0544e3a21e1b56ead73475e90cc8 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 19 Mar 2021 18:24:33 -0400 Subject: added stuff to WebBox so that it will work with Firefox browsers (which have the benefit of rendering web pages without blur the way Chrome does on windows) --- src/client/views/nodes/WebBox.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index a60a35b01..bfe8782ac 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -32,6 +32,7 @@ import { FieldView, FieldViewProps } from './FieldView'; import { LinkDocPreview } from "./LinkDocPreview"; import "./WebBox.scss"; import React = require("react"); +const _global = (window /* browser */ || global /* node */) as any; const htmlToText = require("html-to-text"); type WebDocument = makeInterface<[typeof documentSchema]>; @@ -53,6 +54,7 @@ export class WebBox extends ViewBoxAnnotatableComponent(); @observable private _scrollHeight = 1500; @@ -200,6 +202,7 @@ export class WebBox extends ViewBoxAnnotatableComponent this._marqueeing = undefined), 100); // bcz: hack .. anchor menu is setup within MarqueeAnnotator so we need to at least create the marqueeAnnotator even though we aren't using it. } else { + this._iframeClick = this._iframe ?? undefined; this._isAnnotating = true; this.props.select(false); e.stopPropagation(); @@ -207,6 +210,12 @@ export class WebBox extends ViewBoxAnnotatableComponent { + return "InstallTrigger" in window; // navigator.userAgent.indexOf("Chrome") !== -1; + } + iframeClick = () => this._iframeClick; + iframeScaling = () => 1 / this.props.ScreenToLocalTransform().Scale; + @action iframeLoaded = (e: any) => { const iframe = this._iframe; @@ -388,6 +397,7 @@ export class WebBox extends ViewBoxAnnotatableComponent { this._marqueeing = undefined; this._isAnnotating = false; + this._iframeClick = undefined; x !== undefined && y !== undefined && this._setPreviewCursor?.(x, y, false); } @@ -493,6 +503,8 @@ export class WebBox extends ViewBoxAnnotatableComponent {!this._marqueeing || !this._mainCont.current || !this._annotationLayer.current ? (null) :