diff options
author | geireann <geireann.lindfield@gmail.com> | 2023-08-08 16:25:10 -0400 |
---|---|---|
committer | geireann <geireann.lindfield@gmail.com> | 2023-08-08 16:25:10 -0400 |
commit | ab9cc075775e9451611395ad27dc20ca58dda9ff (patch) | |
tree | a9fc7f953d57f0000653d0f867afa320c925a913 /src/client/views/nodes/WebBox.tsx | |
parent | 2b31bb73accaa2a6420242eddb60a309774de02a (diff) |
fixed searching web pages that are not cors readable to not generate an error
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r-- | src/client/views/nodes/WebBox.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index 34a1229ba..f5df42161 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -125,11 +125,15 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps this._searchRef.current?.setRangeText(searchString); }); } - if (clear) { - this._iframe?.contentWindow?.getSelection()?.empty(); - } - if (searchString) { - (this._iframe?.contentWindow as any)?.find(searchString, false, bwd, true); + try { + if (clear) { + this._iframe?.contentWindow?.getSelection()?.empty(); + } + if (searchString) { + (this._iframe?.contentWindow as any)?.find(searchString, false, bwd, true); + } + } catch (e) { + console.log("WebBox search error", e) } return true; }; |