javascript - Upload image in chrome extension and extension popup closes -


i need upload image chrome extension, when file browser clicked extension popup closes. how can handle both file browser , popup remain open.

it's tricky question answer.

the basic idea whenever popup window loses focus, supposed close, entails destruction of popup's javascript context (and logic breaks result). not can influence.

modal dialogs such file input ought exception, doesn't work consistently across platforms chrome runs on. evidence: question, bug.

whenever want survive popup closing, put in background page. lead this workaround places file input in background page , triggers selection popup. but there's (unconfirmed) evidence not work anymore. question above has another, supposedly working answer injecting input tag current page, that's subject failing on "unscriptable" pages such chrome web store or internal chrome:// pages.

the safest way open separate tab or popup window handle process. awkward ux though.


Comments

Popular posts from this blog

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -