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

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -