0

I am working with a web-page or a user-script (It's not about chrome extension) and as per my requirement i wants to open incognito mode.

Here is my JavaScript Code:

$('#google_alert').on('click', function(e)
{
    swal({
        title: "Review Us",
        text: "You will be redirected to review us on google",
        type: "warning",
        showCancelButton: true,
        confirmButtonColor: "#09a275",
        confirmButtonText: "Positive",
        cancelButtonText: "Negative",
        closeOnConfirm: false,
        closeOnCancel: true
    }, function(isConfirm)
    {
        if(isConfirm)
        {
            chrome.windows.create({"url": "http://www.google.com", "incognito": true});

        swal("Thank you", "Thank you reviewing us.", "success");
        }
        else
        {
            $("#review-modal").modal('show');
        }
    });
    return false;
});

Response: ReferenceError: chrome is not defined

Here is procedure of what i am doing,

  1. click on google review option on web page,
  2. it will redirect user to google review page,
  3. google ask to login,
  4. user enter credential and provide review,
  5. back to web page.

Here you can see that no need to save user's ID and passwords into browser.

0 Answers0