Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
0
Question by ctapp1 · Mar 09, 2016 at 12:13 PM · canvaswebglresolutionfullscreen

Disable fullscreen for webgl

I had an issue with my project deploying for webgl. Basically all monitors are different and I want the game to be consistent for everyone playing. I set my resolution to deploy in a certain resolution, but the fullscreen button that is default with the webgl template/loader just makes the game fullscreen for whatever monitor and resolution you have. For the most part my game doesn't change much but there are still some aspects that don't work like they should if in the original resolution. Since this seems kind of buggy reading through the forums, is there a way to remove the fullscreen button entirely? so I can just avoid this issue for now. Thanks

Comment
Add comment
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

4 Replies

· Add your reply
  • Sort: 
avatar image
5
Best Answer

Answer by ctapp1 · Mar 09, 2016 at 05:18 PM

To fix this issue, I changed the default template in 'player settings' to just the blank white one. I don't have a loading bar now but the fullscreen button is gone.

I could probably find a custom template that will have a loading bar and not have the fullscreen option, just haven't looked yet.

Comment
Add comment · 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
9

Answer by coolraiman · May 03, 2016 at 02:25 PM

go in C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\WebGLTemplates here you will see all your template

copy and paste the default folder and name it default no full screen

this will add a new template into your unity editor

then go in your new folder, then edit index.html and remove the line with the div class="fullscreen" then go in the template data folder and remove the fullscreen.png

you will now have a new template in your unity with no fullscreen and the loadingbar

Comment
Add comment · Show 2 · 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 Okrim · Nov 15, 2016 at 09:05 AM 0
Share

Thanks a lot!

avatar image Popelsas · Dec 14, 2020 at 07:11 PM 0
Share

It doesn't work now. Is there an up-to-date way?

avatar image
0

Answer by Popelsas · Dec 14, 2020 at 02:10 PM

It doesn't work anymore. Are there current options?

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 MSavioti · Feb 09, 2021 at 03:30 AM 0
Share

It works, the path is just a little different.

avatar image
0

Answer by maxsumae · Jul 14, 2021 at 04:49 PM


I was able to stop the Unity WebGL fullscreen default action for my Unity 2019.1.3 project by editing the UnityLoader.js file found in the "Build" directory created when you make a build.


I removed "(e.requestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullScreen)&&(a.indexOf("Safari")==-1||s>=10.1)?1:0" from the "hasFullscreen:function()".


B E F O R E :


hasFullscreen:function(){var e=document.createElement("canvas");return(e.requestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullScreen)&&(a.indexOf("Safari")==-1||s>=10.1)?1:0}


A F T E R :


hasFullscreen:function(){var e=document.createElement("canvas");return}



I have not thoroughly tested this yet on all browsers, but so far it has stopped the "dreaded FullScreen attack" when viewing my WebGL build in Chrome, firefox, Vivaldi and Safari browsers.


Clearly this is a hack... lol... your mileage may vary.


Comment
Add comment · 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

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

9 People are following this question.

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

Related Questions

WebGL and Canvas Scaling - Canvas won't scale according to Browser Window Size 0 Answers

The game resolution changes from editor to android device,How can i fix the resolution for android games? 0 Answers

WebGL automaticly goes fullscreen on first click 1 Answer

Orientation Issue in Uniry Remote 5 1 Answer

WebGL Build cutting out top and bottom of UI Canvas elements 2 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