Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UFrameIT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FrameIT
UFrameIT
Commits
8daeaa68
Verified
Commit
8daeaa68
authored
9 months ago
by
Björn Eßwein
Browse files
Options
Downloads
Patches
Plain Diff
fixed race condition in tab.getDocument by replacing it with an awaitable property
parent
9363d319
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assets/Scripts/UI/InGame/WebViewController.cs
+6
-2
6 additions, 2 deletions
Assets/Scripts/UI/InGame/WebViewController.cs
Packages/bessw.unity.webview
+1
-1
1 addition, 1 deletion
Packages/bessw.unity.webview
with
7 additions
and
3 deletions
Assets/Scripts/UI/InGame/WebViewController.cs
+
6
−
2
View file @
8daeaa68
...
...
@@ -35,6 +35,10 @@ private void OnWebViewComponentReady()
SwitchScrollUI
.
activeScrollData
.
OnScrollDynamicInfoUpdated
.
AddListener
(
SetScrollContent
);
webViewComponent
.
tab
.
AddJSBinding
(
"applyScroll"
,
ApplyScrollHandler
);
webViewComponent
.
tab
.
AddJSBinding
(
"getHint"
,
GetHintHandler
);
if
(
SwitchScrollUI
.
activeScrollData
.
Scroll
is
not
null
)
{
SetScrollContent
(
SwitchScrollUI
.
activeScrollData
.
Scroll
);
}
RegisterBrowserEventhandlers
();
}
private
void
OnDisable
()
...
...
@@ -61,7 +65,7 @@ private async void RegisterBrowserEventhandlers()
// register c# event handlers
// get the dropzones from the scroll and add the event handler to track when something is dropped
DomNodeWrapper
document
=
await
webViewComponent
.
tab
.
Get
Document
()
;
DomNodeWrapper
document
=
await
webViewComponent
.
tab
.
Document
;
dropzones
=
await
document
.
querySelectorAllAsync
(
"[dropzone='copy']"
);
dropzones
.
ForEach
(
dropzone
=>
dropzone
.
OnAttributeModified
+=
DropzoneAttributeModifiedHandler
);
}
...
...
@@ -78,7 +82,7 @@ private void DeRegisterBrowserEventhandlers()
private
async
void
SetScrollContent
(
Scroll
scroll
)
{
// update scroll container content
DomNodeWrapper
document
=
await
webViewComponent
.
tab
.
Get
Document
()
;
DomNodeWrapper
document
=
await
webViewComponent
.
tab
.
Document
;
DomNodeWrapper
scrollContainer
=
await
document
.
querySelectorAsync
(
"#scrollContainer"
);
var
description
=
scroll
.
description
;
...
...
This diff is collapsed.
Click to expand it.
bessw.unity.webview
@
8cd56ed2
Compare
32bbc9be
...
8cd56ed2
Subproject commit
32bbc9be2e099918d10d0e54e
8993
cae6e54799a
Subproject commit
8cd56ed2cf3b543fcc6d
89
5
93
2a6f13e6b9400fd
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment