orcasgit / python-fitbit

Fitbit API Python Client Implementation
Other
623 stars 330 forks source link

Close Chrome tab after validating API #153

Closed mrkaye97 closed 4 years ago

mrkaye97 commented 4 years ago

Hey,

I dug around in the code a little but couldn't find it. Is there a way to automate closing the tab that opens when you go to validate the permissions for the API? Would be nice to not need to close the tab every time.

Thanks!

bikramb98 commented 4 years ago

Any idea about this?

mrkaye97 commented 4 years ago

Any idea about this?

Nope, still nothing

MiniXC commented 4 years ago

This could be done using javascript. Currently gather_keys_oauth2.py uses the following:

self.success_html = """
            <h1>You are now authorized to access the Fitbit API!</h1>
            <br/><h3>You can close this window</h3>
            """

Instead, you could just use

self.success_html = """
            <script>window.close();</script>
            """