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

Chrome permission request causes app to close #5400

Open
bayssmekanique opened this Issue Oct 25, 2016 · 1 comment

Comments

Projects
None yet
4 participants
@bayssmekanique

bayssmekanique commented Oct 25, 2016

When I perform a permission request the app stalls for a second and then closes without showing the permission request that normally appears when the app runs in Chrome.

If I open devtools, then the prompt will appear and I'm able to give access and everything works correctly.

The documentation made is sound as if all permissions should already be set to true when the app starts, but because this is a specific USB interface that requires being requested, I'm assuming it doesn't have a pre-existing permission override. Are there any suggestions?

Here's the request code if it matters:

    const DALLAS_VENDOR_ID = 0x04FA;
    const DALLAS_PRODUCT_ID = 0x2490;
    const DEVICE_INFO = {
        'vendorId': DALLAS_VENDOR_ID,
        'productId': DALLAS_PRODUCT_ID,
    };

    const permissionObj = {
        permissions: [
            {
                'usbDevices': [DEVICE_INFO]
            }
        ]
    };

    ow.permission.request = function() {
        var deferred = Q.defer();
        chrome
            .permissions
            .request(permissionObj, function(result) {
                if (result) {
                    deferred.resolve();
                } else {
                    deferred.reject();
                }
            });
        return deferred.promise;
    };

I am running on Windows 10.

@abby03il05

This comment has been minimized.

Show comment
Hide comment
@abby03il05

abby03il05 Oct 19, 2017

Hacktoberfest added 26 October 2017

abby03il05 commented Oct 19, 2017

Hacktoberfest added 26 October 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment