Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window features are ignored #56

Open
MidnightJava opened this issue Oct 4, 2019 · 7 comments
Open

Window features are ignored #56

MidnightJava opened this issue Oct 4, 2019 · 7 comments
Assignees

Comments

@MidnightJava
Copy link

MidnightJava commented Oct 4, 2019

I can't find any way to set window features. I submit an object as the features property, and none of the mappings in that object are set as window features. That includes numeric values, like left or top, and boolean values like titlebar or scrollbars (I tried a boolean value and also string "yes/no"). I also tried setting the name property to "_blank" or leaving it out, since the JS API says strWindowFeatures will be ignored if opening an existing window. No matter what I do, all window features are ignored. EDIT: I found that width and height features are respected. But no others AFAICT.

@zning
Copy link

zning commented Oct 24, 2019

Same here. Great library with little tweaks

@dimitridumont
Copy link

Same here. Do you have an issue ?

@DerekSteinke
Copy link

So this issue likely because most modern browsers override window features by default (due to potential security risks), not an issue with the library.

See here in the Mozilla docs for more details

@MidnightJava
Copy link
Author

Thanks for your reply. In that case, there is at least an issue with the library's API, correct? I was trying to do what the API said I could do, and it was silently ignored. If most modern browsers override this behavior, then perhaps it should be removed from the API. Or at least a note should be added saying that this will not work on most browsers.

@DerekSteinke
Copy link

I agree completely. At the least, a note in the docs should be included to make users aware of likely compatibility issues. I think there could still some cases where Window features are usable; like native applications running browser engines (stuff like Electron app). Even then, I'd think there are better options.

@rmariuzzo rmariuzzo self-assigned this Nov 27, 2022
@rmariuzzo
Copy link
Owner

Will improve the docs with all your suggestion. Thank you all for the valuable discussion. Also, I apologize for the long reply.

@rmariuzzo rmariuzzo changed the title Window Features always ignored Window features are ignored Nov 27, 2022
@ASutrick
Copy link

ASutrick commented Aug 22, 2024

Sorry to bring this old issue back up but window features are still ignored. I can call window.open manually and pass a string like left=${1920},top=${-421},width=${1080},height=${1920},fullScreen=yes and it functions as intended.

it appears that the center prop and its associated logic is what's causing the issue. I have made and published a fork to remove that prop and logic (i didnt use it anyway) and now window placement works fine.

if this package is still maintained please consider reworking the center prop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants