Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
4
Question by hippogames · Mar 01, 2017 at 05:53 AM · webgldrag-and-dropbrowseredge

[WebGL] UI drag in Edge browser

Hi! My WebGL game is published on Facebook. I have an issue when Empty document icon randomly appears in Edge browser if I'm trying to drag some UI elements (buttons for example). My steps are: - press UI button and hold it (1-2 seconds) - drag mouse cursor when pressed - empty document icon appeared (marked with red frame on screenshot)

How can I avoid such behaviour? Looks like drag & drop function in Edge working with WebGL content.

alt text

bug.png (472.2 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CaptParis · Dec 07, 2017 at 12:39 AM 0
Share

I am also having this serious issue! And like 'CodeBear' said, for us the entire webgl window "pops" out and get's dragged around the screen like an image attached to the cursor!

avatar image CodeBear · Dec 07, 2017 at 01:04 AM 0
Share

We're seeing the same thing @hippogames . In our case, the entire game window gets dragged around and treated like a document or image (similar to what happens if you try to save an image to your computer by dragging it out of a web page onto your desktop). Any Unity folks have input?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Hogarth_BR · Jan 04, 2018 at 08:55 PM

@hippogames Try this, on your WebGL Template after loading the game do this: document.getElementsByTagName('canvas')[0].ondragstart = function() { return false; };

This worked for me.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hemaolle · Oct 25, 2019 at 09:44 AM 0
Share

Here's how to run stuff after loading the game:

 <script>
     var gameInstance = UnityLoader.instantiate("gameContainer", "%UNITY_WEBGL_BUILD_URL%",
     {
     onProgress: UnityProgress,
     $$anonymous$$odule: {
         onRuntimeInitialized: () => {
         // Fix dragging sometimes showing an empty document / "not allowed" icon
         document.getElementsByTagName('canvas')[0].ondragstart = function() { return false; };
         }
     }
     });
 </script>

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

100 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

open PDF on WebGL 0 Answers

WebGL: RuntimeError: memory access out of bounds. 6 Answers

WebGL Build uses old script, can't update to a newer version! 1 Answer

WebGL browser error after run and built Unity+ARToolkit project 0 Answers

WebCamTexture on Mobile Browser 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges