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

tmplat blocked by navigator.geolocation.getCurrentPosition() #235

Open
leesei opened this issue Apr 18, 2018 · 1 comment
Open

tmplat blocked by navigator.geolocation.getCurrentPosition() #235

leesei opened this issue Apr 18, 2018 · 1 comment

Comments

@leesei
Copy link

leesei commented Apr 18, 2018

When a template is triggered, only log of progress bar to 30% is shown and nothing happens then.
Minutes later it will creates popup notifying the template is done.

09:52:51.070 Updating bar progress to 10%
09:52:51.083 log.js:2 Updating bar progress to 20%
09:52:51.086 log.js:2 Updating bar progress to 30%
# halts and no more log
# ...
09:59:11.439 log.js:2 Updating bar progress to 40%
09:59:11.442 log.js:2 Updating bar progress to 60%
09:59:11.443 log.js:2 Updating bar progress to 70%
09:59:11.444 log.js:2 Updating bar progress to 100%
09:59:11.452 log.js:2 Used the Markdown template
09:59:11.458 log.js:2 Updating statistics
@leesei leesei changed the title Template does not work properly in recent month tmplat does not work properly in recent month Apr 18, 2018
@leesei
Copy link
Author

leesei commented Apr 18, 2018

I ran with source code and figured out that tmplat is blocked by navigator.geolocation.getCurrentPosition() call.

11:01:04.544 log.js:2 Creating popup list item for the Short template
11:01:04.547 log.js:2 Creating popup list item for the Markdown template
11:01:04.548 log.js:2 Creating popup list item for the Selection in Markdown template
11:01:04.554 log.js:2 Creating popup list item for the Short template
11:01:04.555 log.js:2 Creating popup list item for the Markdown template
11:01:04.556 log.js:2 Creating popup list item for the Selection in Markdown template
11:01:59.434 log.js:2 Widest textual item in popup is 260px
11:02:03.443 log.js:2 Sending the following message to the extension controller
11:02:03.443 log.js:2 {data: {…}, type: "popup"}
11:02:03.456 log.js:2 Checking the following tabs for the active tab...
11:02:03.457 log.js:2 [{…}]
11:02:03.479 log.js:2 Checking activity of supported extension 'hehijbfgiekmjfkfjpbkbammjbdenadd'
11:02:03.481 log.js:2 Checking activity of supported extension 'miedgcmlgpmdagojnnbemlkgidepfjfi'
11:02:03.482 log.js:2 Checking activity of supported extension 'fnfnbeppfinmnjnjhedifcfllpcfgeea'
11:02:03.483 log.js:2 Checking activity of supported extension 'icoloanbecehinobmflpeglknkplbfbm'
11:02:03.510 log.js:2 Extracting the URLs from the following tabs...
11:02:03.511 log.js:2 [{…}]
11:02:03.511 log.js:2 Chrome automatically detected language: en
11:02:03.512 log.js:2 Found the following cookies...
11:02:03.512 log.js:2 (7) [{…}, {…}, {…}, {…}, {…}, {…}, {…}]
11:02:03.513 log.js:2 The following data was retrieved from the content script...
11:02:03.514 log.js:2 undefined
11:11:47.587 log.js:2 Retrieved the following geolocation information...
11:11:47.587 log.js:2 Position {coords: Coordinates, timestamp: 1524021107498}
11:11:47.589 log.js:2 Using the following data to render Selection in Markdown...
11:11:47.589 log.js:2 {fragment: "", query: "", file: "", directory: "/sessions", path: "/sessions", …}
11:11:47.592 log.js:2 The following was generated as a result...
11:11:47.593 log.js:2 
11:11:47.594 log.js:2 Selection in Markdown output was empty
11:11:47.597 log.js:2 Finished handling a Popup request
11:11:47.610 log.js:2 Opened desktop notification: b014af74-19aa-4e91-99c7-fad050fd6a1c

I "fixed" the issue locally by disabling geolocation:

@@ -846,6 +846,9 @@ addAdditionalData = (tab, data, id, editable, shortcut, link, callback) ->
         done null, {locale}
 
     (done) ->
+      log.warn 'Disabling geolocation'^M
+      done null, coords: {}^M
+^M
       # Retrieve the geolocation from the client.
       navigator.geolocation.getCurrentPosition (position) ->
         log.debug 'Retrieved the following geolocation information...', position

Note sure if this is related:
html5 - Is there a way to check if geolocation has been DECLINED with Javascript? - Stack Overflow

This is the output when when running in background.html:

navigator.permissions.query({'name': 'geolocation'})
.then( permission => console.log(permission) )
PermissionStatus {state: "prompt", onchange: null}

Maybe using this options to navigator.geolocation.getCurrentPosition() would help:

var options = {
  enableHighAccuracy: false,
  timeout: 0,
  maximumAge: Infinity
};

@leesei leesei changed the title tmplat does not work properly in recent month tmplat blocked by navigator.geolocation.getCurrentPosition() Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant