title: How can I get active range/selection in Google Spreadsheets when a script is deployed as a Web App?
body: <p>I found that functions like getActiveRange(), getActiveSelection() work only when a script runs as a Custom Function in Spreadsheets or a Container Extension (see <a href="https://developers.google.com/apps-script/execution_methods" rel="nofollow">Execution Methods for Scripts</a>). Is my observation correct? Is there any way to deploy script as a Web App, open a spreadsheet using <a href="https://developers.google.com/apps-script/class_spreadsheetapp#openById" rel="nofollow">SpreadsheetApp.openById()</a> and get active range/selection, assuming the owner of the spreadsheet has it opened in Drive?</p>
  
  <p>The matter is I'm making an extension for Google Spreadsheets, but for building my custom UI I don't want to use <a href="https://developers.google.com/apps-script/html_service" rel="nofollow">Html Service</a> or <a href="https://developers.google.com/apps-script/uiapp" rel="nofollow">UI Service</a>, I want traditional plain HTML/JS. So, I render my UI on a page, I open a spreadsheet in iframe and then my UI calls Google Scripts as a service, meaning I deploy scripts as Web Apps (which automate different spreadsheet tasks) and call them with URL parameters. It works fine except I can't get active range/selection which is a deal breaker for my application.</p>