Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 /
avatar image
0
Question by Madswint · Nov 13, 2013 at 01:10 AM · webplayerhtmlcontextmenu

HTML / Webplayer help! Where do I add this line of code on the HTML script for it to disable context menu?

This is my webplayer script

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
     <head>
 
         <title>Unity Web Player | RP clicker demo</title>
 
         <script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script>
 
         <script type="text/javascript">
 
         <!--
 
         function GetUnity() {
 
             if (typeof unityObject != "undefined") {
 
                 return unityObject.getObjectById("unityPlayer");
 
             }
 
             return null;
 
         }
 
         if (typeof unityObject != "undefined") {
 
             unityObject.embedUnity("unityPlayer", "RP clicker demo.unity3d", "100%", "100%");
 
         }
 
         -->
 
         </script>
 
         <style type="text/css">
 
         <!--
 
         body {
 
             font-family: Helvetica, Verdana, Arial, sans-serif;
 
             background-color: white;
 
             color: black;
 
             text-align: center;
 
             margin: 0;
 
             padding: 0;
 
             height: 100%;
 
         }
 
         a:link, a:visited {
 
             color: #000;
 
         }
 
         a:active, a:hover {
 
             color: #666;
 
         }
 
         p.header {
 
             font-size: small;
 
         }
 
         p.header span {
 
             font-weight: bold;
 
         }
 
         p.footer {
 
             font-size: x-small;
 
         }
 
         div.content {
 
             padding: 0px;
 
             margin: 0px;
 
             height: 100%;
 
             width: 100%;
 
         }
 
         div.missing {
 
             margin: auto;
 
             position: relative;
 
             top: 50%;
 
             width: 193px;
 
         }
 
         div.missing a {
 
             height: 63px;
 
             position: relative;
 
             top: -31px;
 
         }
 
         div.missing img {
 
             border-width: 0px;
 
         }
 
         div#unityPlayer {
 
             margin: 0px;
 
             padding: 0px;
 
             cursor: default;
 
             height: 100%;
 
             width: 100%;
 
         }
 
         -->
 
         </style>
 
     </head>
 
     <body>
 
         <div class="content">
 
             <div id="unityPlayer">
 
                 <div class="missing">
 
                     <a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">
 
                         <img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" />
 
                     </a>
 
                 </div>
 
             </div>
 
         </div>
 
     </body>
 
 </html>

Where do I add this code to config.params["disableContextMenu"] = true;

What I need is to disable context menu from this HTML, since this HTML makes my webplayer game 100% size (fill the whole browser), which cant be done from a regular unity 3d no context build. Any help greatly appreciated, I'm stuck at dis ._.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by nventimiglia · Nov 13, 2013 at 01:15 AM

http://stackoverflow.com/questions/381795/how-to-disable-right-click-context-menu-in-javascript

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

17 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

Related Questions

Player statics help 1 Answer

How to make Unity's Own Web Player Code Validate? Loading UnityObject2; document.write() line can't validate 0 Answers

HTML text box in iPhone Unity? 0 Answers

Webplayer telling me to install but its already been installed? 3 Answers

custom webplayer not building project 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