oshah97 / experiments

Practicing with scrolling and resizing
MIT License
0 stars 1 forks source link

openWindow.html: in a new tab vs. as a free-standing popup #1

Open paul-shannon opened 7 years ago

paul-shannon commented 7 years ago

Clicking the "Help" button on my laptop, running chrome, the help text appears in a small & attractive well-centered window.

@oshah97 gets a new tab.

What controls this? What do we want? How do other browsers perform?

FinnSoutherland commented 7 years ago

According to https://stackoverflow.com/questions/15818892/chrome-javascript-window-open-in-new-tab, it depends on user settings, among other things. It appears that if we want to force the text to appear in a new window, we can have the user-initiated function 'defer' the window.open call to another function. Since it is then not considered a user-initiated action, it opens in a new window. I'll put a version with this change up, though someone with a different browser should check it out.

oshah97 commented 7 years ago

Nice! Here's what I got when I ran it: It opens a new tab in Chrome and then a small window in the center of the screen on Safari.