How to open incognito window using extension when user clicks a button on a webpage - google-chrome-extension

I'm working on creating a voting site of some sorts. There will be a laptop at a physical location at my school and one of the pain points I need to solve is that since my site uses sign in with google, it becomes a hassle to sign everyone out and let the next person sign in, so I thought of opening an incognito tab to store session data when someone wants to vote, so that they just need to close the tab to clear their session data. I know that only an extension is allowed to open incognito tabs, and it would require the "tabs" permission, but how would I go about making it so that when someone clicks on the button on my site, my extension opens an incognito window for them to sign in?
let's say for instance when I click
<button id="open_Incognito">Start Session</button> it would open an incognito tab.

Related

How can i open multiple web browser window without cookies?

how can I open a new browser window without cookies ?
I mean, the window shouldn't remember the last session. If I log in to my google account and open new tabs or a new browser window, the browser will show me the same account again.
So, how can I solve this problem ? Thanks for the help

Facebook 'Continue' button misplaced in Chrome Extension oauth popup

I'm using chrome.identity.launchWebAuthFlow to start the login flow and when the user oauths with Facebook, the bottom 'Continue' button is partially out of the view. When the user has to enter an email and password for the first time, it's fine, but when Facebook asks only for the password the next time, the issue occurs. Also on the 'Forgotten you password?' page.
Since chrome.identity.launchWebAuthFlow doesn't allow to set size, and resizing the window manually moves the button, but at the same misplaced position, I see it as a clear sign that it's Facebook's code or the chrome.identity.launchWebAuthFlow's window's quirk.
When opening up the same auth url in a real browser window, the button is placed at the right place.
Anyone else came across this issue? Is there any good workaround?

What does a browser session mean in the context of chrome extension

Please note, this question is not about client-server sessions. It's about Chrome session.
I'm reading this article about tabId and it states that:
Tab IDs are unique within a browser session.
What is browser session here? Does the session begin when I open a browser and ends when I close it? Is there a way to track tab across sessions?
What is browser session here? Does the session begin when I open a browser and ends when I close it?
That's correct. It means a tab will preserve its ID only until you close the browser.
Even if the browser is configured to reopen the previews windows on startup, they will all have a different tab ID and window ID.
Is there a way to track tab across sessions?
Yes, with the tabs permission! Mostly.
The IDs will be different but you can query all the open tabs and windows and you will receive the position of a tab in a window (e.g. first tab in window 2) together with its URL. You'd have to regularly query and save this data via chrome.storage.local.set()
You can then compare this piece of information to the data you stored before closing the browser and match them to each other. For example you receive tab on position 1, with URL xyz, in a window with 3 other tabs, you can find a tab with the same details in your storage.
The "mostly" part: If the user has 2 windows with 1 tab, both pointing to the same page, you won't be able to tell which is which.

Controlling the behavior of the Browsers Back Button

We created an E-Newsletter for a client that includes lots of story links as well as banner adds. The majority of users are reading the newsletter in MS Outlook. The client thinks users will get confused when they click on a link from the newsletter and it opens in their browser and then the user can't hit the browser's back button in order to get back to the newsletter.
What are my options?
Is it possible to control where the Browsers back button takes the user? I would guess not for security reasons.
If I have the newsletter links go through our main site and then redirect to the desired page (story or ad), can I do it in such a way that the back button will work and won't result in the user being redirected back to the redirect page?
Is there a better approach?
Overall, the back and forward buttons step the user through the history and for security reasons, there is very little you can do about that. But ...
You do have a certain amount of control over the history. In particular, page 1 can say "go to page 2", and once the user is on page 2, the back button will return the user to page 1 OR page 1 can say "replace me in history with page 2"; then once the user is on page 2, the back button will return the user whatever was before page 1, if anything. This is a good way to Orwell redirect pages right out of memory.
See here for details.

Have you ever seen as i have checked session behaviour in gmail.com ? Please help?

Yesterday morning i open gmail account in Internet Exlorer second tab. I checked my mail and closed that tab (not browser).
Then at the time of evining i again open second tab of browser and enetr gmail.com, it automatically redirect me at my email account without asking login.
I shocked and i thought i should remain browser open for whole night and today open gmail in second tab , it behave similar means without login screen it redirect in my gmail account.
Then i closed that tab and open another browser session and enter gmail i again surprised that i redirect me login page. At the same time i open second tab of first browser and it automatically redirect me at mail account page.
What i councluded by this behaviour is that might be gmail server keep my browser id at their server so that whenever i eneter gmail.com on second tab of first browser, it automatically redirect me at gmail account. I don't know i am right or not?
Please clear me this concept? What happens with my session at gmail server when i closed my browser tab?
As per my opinion it should automatically logout me but why this doesn't happened?
You probably ticked the option "stay signed in" the last time you logged in. Go back to gmail, click log out, and log in again, making sure that option is not ticked. Close the tab, come back in an hour, and open gmail again. You should be at the login screen this time.

Resources