Example #1
0
        public void FinishedLoading(string url)
        {
            string command  = "";
            string command2 = "var div = document.createElement('div'); div.style.zIndex = 1000002; div.style.position = 'absolute'; div.style.height = '100vh'; div.style.width = '100vw'; div.style.backgroundColor = 'white'; document.body.insertBefore(div, document.body.childNodes[0]);div.id = 'loadingDiv';";

            InAppBrowser.ExecuteJS(command2);
            if (stepInGame == 0)
            {
                StartCoroutine(CreateGame());
                // command = "var interval1 = setInterval(function(){ try { document.getElementsByClassName('Landing__cta CreateGame')[0].click(); console.log('worked1'); clearInterval(interval1);} catch { console.log('timeout1');}; }, 100);";
                // InAppBrowser.ExecuteJS("console.log('here');");
                // command = "document.getElementsByClassName('Landing__cta CreateGame')[0].click();";
                stepInGame++;
            }
            else if (stepInGame == 1)
            {
                command = "var interval = setInterval(function(){ try { document.getElementsByClassName('MenuBar')[0].style.display = 'None'; document.getElementsByClassName('ToolBoxToast')[0].style.display = 'None'; document.getElementsByClassName('prettyButton')[0].click(); document.getElementById('loadingDiv').style.display = 'none'; console.log('worked'); " + navigationJSV2 + " clearInterval(interval);} catch { console.log('timeout');}; }, 10);";
                stepInGame--;
                string gameCode = url.Split('/')[url.Split('/').Length - 1];
                character.SetGame(currentGameName, gameCode);
                // get from the url the game code
                // we need to set the collider from the beggining -> we use prc to send to our other characterScript instances that we are on a game - with a game name
                // when we collider with another characterscript we check if they are in game and their game name and their code. We enable button to join and then we join
            }
            InAppBrowser.ExecuteJS(command);
        }
Example #2
0
 public void OnButtonClicked()
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "Local File Example";
     InAppBrowser.OpenLocalFile(pathToFile, options);
 }
Example #3
0
 public void OnHTMLClicked()
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "HTML Example";
     InAppBrowser.LoadHTML(htmlToLoad, options);
 }
Example #4
0
 void Btn1()
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.browserBackgroundColor = "blue";
     options.hidesTopBar            = true;
     InAppBrowser.OpenURL(pageToOpen, options);
 }
Example #5
0
 public void OpenBrowser(string url)
 {
     if (url.Equals("init"))
     {
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(initialPage, options);
     }
     if (url.Equals("moto"))
     {
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(motoPage, options);
     }
     if (url.Equals("laptop"))
     {
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(laptopPage, options);
     }
     if (url.Equals("refri"))
     {
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(refriPage, options);
     }
     if (url.Equals("tv"))
     {
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(tvPage, options);
     }
 }
Example #6
0
 // check readme file to find out how to change title, colors etc.
 public void OnButtonClicked()
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "InAppBrowser example";
     InAppBrowser.OpenURL(pageToOpen, options);
 }
Example #7
0
    // check readme file to find out how to change title, colors etc.
    public void OpenBrowser()
    {
        InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
        options.displayURLAsPageTitle = false;

        InAppBrowser.OpenURL(Manager.Instance.controllerUrl, options);
    }
Example #8
0
 public void Regresar()
 {
     if (MotoContainer.gameObject.activeSelf)
     {
         regresarPanel.gameObject.SetActive(false);
         MotoContainer.gameObject.SetActive(false);
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(motoPage, options);
     }
     if (LaptopContainer.gameObject.activeSelf)
     {
         regresarPanel.gameObject.SetActive(false);
         LaptopContainer.gameObject.SetActive(false);
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(laptopPage, options);
     }
     if (RefriContainer.gameObject.activeSelf)
     {
         regresarPanel.gameObject.SetActive(false);
         RefriContainer.gameObject.SetActive(false);
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(refriPage, options);
     }
     if (TvContainer.gameObject.activeSelf)
     {
         regresarPanel.gameObject.SetActive(false);
         TvContainer.gameObject.SetActive(false);
         InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
         options.hidesTopBar = true;
         InAppBrowser.OpenURL(tvPage, options);
     }
 }
Example #9
0
 // check readme file to find out how to change title, colors etc.
 public void OnButtonClicked()
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "";
     options.textColor             = "00000000";
     InAppBrowser.OpenURL(pageToOpen, options);
 }
 void OnMessageFromJS(string jsMessage)
 {
     if (jsMessage.Equals("ping"))
     {
         Debug.Log("Ping message received!");
         InAppBrowser.ExecuteJS(javaScriptCode);
     }
 }
 // check readme file to find out how to change title, colors etc.
 public void Open()
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "";
     options.hidesTopBar           = true;
     InAppBrowser.OpenURL(pageToOpen, options);
 }
Example #12
0
        IEnumerator CreateGame()
        {
            yield return(new WaitForSeconds(1.5f));

            string command = "var interval1 = setInterval(function(){ try { document.getElementsByClassName('Landing__cta CreateGame')[0].click(); console.log('worked1'); clearInterval(interval1);} catch { console.log('timeout1');}; }, 10);";

            InAppBrowser.ExecuteJS(command);
        }
Example #13
0
 public static void OpenLocalFile(string filePath, DisplayOptions displayOptions)
 {
             #if UNITY_IOS && !UNITY_EDITOR
     var path = InAppBrowser.PathCombine(Application.streamingAssetsPath, filePath);
     iOSInAppBrowser.OpenURL(path, displayOptions);
             #elif UNITY_ANDROID && !UNITY_EDITOR
     AndroidInAppBrowser.OpenURL(filePath, displayOptions);
             #endif
 }
 public void OpenWebView()
 {
     UnlockDialog_Panel.SetActive(false);
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.backButtonText        = "Close";
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "Xplorabox";
     InAppBrowser.OpenURL(Pagetopen, options);
 }
Example #15
0
 //Listener : check if webstrate page is loaded
 void OnMessageFromJS(string jsMessage)
 {
     if (jsMessage.Equals("pageLoaded"))
     {
         Debug.Log("PageLoaded message received!");
         InAppBrowser.ExecuteJS(javaScriptString);
         ui.Hide(screenshotPreview);
     }
 }
Example #16
0
    void Start()
    {
        InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
        options.displayURLAsPageTitle = false;
        options.pageTitle             = "Mise En Abyme";
        options.loadingIndicatorColor = "#FF0000";

        InAppBrowser.OpenURL(pageToOpen, options);
    }
Example #17
0
    public void StartGame()
    {
        InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
        options.displayURLAsPageTitle = false;
        options.pageTitle             = "InAppBrowser example";
        options.loadingIndicatorColor = "#FF0000";
        options.hidesTopBar           = true;

        InAppBrowser.OpenURL("https://www.heraldic.cloud", options);
    }
Example #18
0
 // check readme file to find out how to change title, colors etc.
 public void OnButtonClicked()
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = pageTitle;
     options.pinchAndZoomEnabled   = true;
     options.hidesTopBar           = true;
     InAppBrowser.OpenURL(pageToOpen, options);
     Debug.Log("HERE ");
 }
Example #19
0
    //public string pageToOpen = "http://www.google.com";

    public void OnButtonClicked(string pageToOpen)
    {
        InAppBrowser.DisplayOptions displayOptions = new InAppBrowser.DisplayOptions();
        displayOptions.displayURLAsPageTitle = false;
        displayOptions.backButtonText        = "My back text"; // put your text for Back button here
        displayOptions.pageTitle             = "Your title";   // put your text for top bar here
        displayOptions.barBackgroundColor    = "#FF0000";      // this is #RRGGBB format so that represents red color
        displayOptions.textColor             = "#00FF00";      // this is green
        InAppBrowser.OpenURL(pageToOpen, displayOptions);
    }
    public void OpenWebView()
    {
        string Pagetopen = "https://www.xplorabox.com/mega-special-offer";

        print("Opening web view with link " + Pagetopen);
        InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
        options.backButtonText        = "Close";
        options.displayURLAsPageTitle = false;
        options.pageTitle             = "Xplorabox";
        InAppBrowser.OpenURL(Pagetopen, options);
    }
Example #21
0
    // check readme file to find out how to change title, colors etc.
    public void OnButtonClicked()
    {
        InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
        options.displayURLAsPageTitle = false;
        options.hidesHistoryButtons   = true;
        options.pageTitle             = "Eyelnd Browser";
        options.backButtonText        = "Exit";
        options.textColor             = "#ff8578";

        InAppBrowser.OpenURL(pageToOpen, options);
    }
 private void Update()
 {
     if (isOpen)
     {
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             isOpen = false;
             InAppBrowser.CloseBrowser();
         }
     }
 }
Example #23
0
    public void OnButtonClicked(string pageToOpen)
    {
        InAppBrowser.DisplayOptions displayOptions = new InAppBrowser.DisplayOptions();
        displayOptions.displayURLAsPageTitle = false;
        displayOptions.backButtonText        = "Back";
        displayOptions.pageTitle             = "Lime Crime";
        displayOptions.barBackgroundColor    = "#FF479A";
        displayOptions.textColor             = "#FFFFFF";

        InAppBrowser.OpenURL(pageToOpen, displayOptions);
    }
Example #24
0
 void OpenGame(string gameName)
 {
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "👾 ~spaces~ 👾";
     options.hidesHistoryButtons   = true;
     options.backButtonText        = "Quit";
     options.pinchAndZoomEnabled   = true;
     // ios: left, bottom, top, right
     InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(0, 50, 50, 0);
     options.insets = insets;
     InAppBrowser.OpenURL("https://playingcards.io/game/" + gameName, options);
 }
Example #25
0
 public void JoinGame()
 {
     stepInGame++;
     Debug.Log("zzzz potential code to join : " + potentialGameCode);
     character.JoinedGame();
     InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
     options.displayURLAsPageTitle = false;
     options.pageTitle             = "👾 ~spaces~ 👾";
     options.hidesHistoryButtons   = true;
     options.backButtonText        = "Quit";
     options.pinchAndZoomEnabled   = true;
     InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(0, 50, 50, 0);
     options.insets = insets;
     InAppBrowser.OpenURL("https://playingcards.io/" + potentialGameCode, options);
 }
Example #26
0
        private void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var article = e.SelectedItem as Article;

            if (article == null)
            {
                return;
            }

            var inAppBrowser = new InAppBrowser(article.Url)
            {
                BindingContext = article
            };

            Navigation.PushModalAsync(inAppBrowser);
        }
Example #27
0
    void OnMessageFromJS(string jsMessage)
    {
        Debug.Log(jsMessage + "message received!");

        if (jsMessage.Equals("moto"))
        {
            regresarPanel.gameObject.SetActive(true);

            RefriContainer.gameObject.SetActive(false);
            TvContainer.gameObject.SetActive(false);
            LaptopContainer.gameObject.SetActive(false);

            MotoActivation();
            InAppBrowser.CloseBrowser();
        }
        if (jsMessage.Equals("laptop"))
        {
            RefriContainer.gameObject.SetActive(false);
            TvContainer.gameObject.SetActive(false);
            MotoContainer.gameObject.SetActive(false);

            regresarPanel.gameObject.SetActive(true);
            LaptopActivation();
            InAppBrowser.CloseBrowser();
        }
        if (jsMessage.Equals("refri"))
        {
            MotoContainer.gameObject.SetActive(false);
            TvContainer.gameObject.SetActive(false);
            LaptopContainer.gameObject.SetActive(false);

            regresarPanel.gameObject.SetActive(true);
            RefriActivation();
            InAppBrowser.CloseBrowser();
        }
        if (jsMessage.Equals("tv"))
        {
            RefriContainer.gameObject.SetActive(false);
            MotoContainer.gameObject.SetActive(false);
            LaptopContainer.gameObject.SetActive(false);

            regresarPanel.gameObject.SetActive(true);
            TvActivation();
            InAppBrowser.CloseBrowser();
        }
    }
Example #28
0
    // check readme file to find out how to change title, colors etc.
    public void OnButtonClicked(string pageToOpen)
    {
        this.pageToOpen = pageToOpen;
        InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
        options.displayURLAsPageTitle = false;
        options.pageTitle             = "PAGE TITLE";
        options.backButtonText        = "<";
        options.backButtonFontSize    = "30";
        options.barBackgroundColor    = "#B10034";
        options.textColor             = "#FFFFFF";

        /*
         * int paddingTop = 100;
         * int paddingBottom = 100;
         * int paddingLeft = 100;
         * int paddingRight = 100;
         * InAppBrowser.EdgeInsets insets = new InAppBrowser.EdgeInsets(paddingTop,
         * paddingBottom, paddingLeft, paddingRight);
         * options.insets = insets;
         */
        InAppBrowser.OpenURL(pageToOpen, options);
        print("Opened browser in: " + pageToOpen);
    }
Example #29
0
 public void OnClearCacheClicked()
 {
     InAppBrowser.ClearCache();
 }
Example #30
0
 // Use this for initialization
 void Start()
 {
     Screen.orientation = ScreenOrientation.LandscapeLeft;
     InAppBrowser.ClearCache();
 }