Comments (18)
@atvvarna You need to do with it says, add a "usbDevices" permission dictionary to the "optional_permissions" section of the manifest like this:
"optional_permissions": [
{
"usbDevices": [
{
"vendorId": 3034,
"productId": 10290
},
{
"vendorId": 3034,
"productId": 10296
}
]
}
]
(copied from the Radio Receiver app)
from chrome-extensions-samples.
Are you calling the function during a user gesture? Permissions must be requested in the context of an event handler for a user gesture such as clicking a button.
from chrome-extensions-samples.
Hey @ohmmmo
I too am trying to get the 450 Turbo to work. I figured out how to fix the "device not found" issue, but unfortunately can't get anything to print.
To find the device you'll need to update the product ID in two places:
index.js:
var productId = 0x0021; // changed from 0x0020
manifest.json
"optional_permissions": [ {"usbDevices": [{"vendorId": 2338, "productId": 33}]}] // changed from 32
from chrome-extensions-samples.
#176 fixes this issue. You still need to make the changes I listed above though.
from chrome-extensions-samples.
Thank you @kjantzer . I've added your information in the sample's README.md
from chrome-extensions-samples.
Hi @kjantzer, did you finally manage to print via USB on WIN 7 ?
I'm facing the same problem with the API on Win7. I manage to find the device via chrome.usb.getDevices but I can't open it.
I wonder if it's possible to open a device like an usb thermal printer on win 7.
from chrome-extensions-samples.
@sdaclin sorry, but I only tested on a Mac
from chrome-extensions-samples.
I have done further investigations and chrome usb api can't manage generic text driver. I'm going to write an issue on chromium tracker.
from chrome-extensions-samples.
I have tested http://zadig.akeo.ie/ generic usb drivers for windows and it seems to be ok.
from chrome-extensions-samples.
@kjantzer I was able to detect our printer using the app and also allowed the permission request. But it could not actually print using that printer even after allowing access. I am using Chrome browser on Mac. Any help?
from chrome-extensions-samples.
@RimaSGit – did you apply this patch: 9b9fdd6
Other than trying that, I don't have any other advice. I ended up needing to print with the label writer.
from chrome-extensions-samples.
@kjantzer Thank you Kevin. I have the same patch. The other thing I wanted to make sure is the info endpoint which is “2”, I am not sure how to I get that for my device?
I did use the chrome.usb.listInterfaces to get all that data, there are many endpoints listed in it, so I am not sure which one to use and if I need to convert this to raw address before using it?
Thanks a lot.
from chrome-extensions-samples.
Unfortunately what you said goes right over my head. I have very little experience with hardware and low level programming.
I know that on a mac you can get some device info by opening "System Information"
from chrome-extensions-samples.
I've set everything but always get in the log:
App was not granted the "usbDevices" permission.
Object {message: "Optional permissions must be listed in extension manifest."}
I didn't see the permission window.
Any help?
from chrome-extensions-samples.
I think you need this in your manifest.json for usb permissions
"usb_printers":{
"filters":[
{
"vendorId": yourvendorID
}
]
},
"permissions": [
"usb",
...........
From: atvvarna <[email protected]mailto:[email protected]>
Reply-To: GoogleChrome/chrome-app-samples <[email protected]mailto:[email protected]>
Date: Friday, May 20, 2016 at 12:15 PM
To: GoogleChrome/chrome-app-samples <[email protected]mailto:[email protected]>
Cc: Microsoft Office User <[email protected]mailto:[email protected]>, Mention <[email protected]mailto:[email protected]>
Subject: Re: [GoogleChrome/chrome-app-samples] chrome.usb device not found on Windows (#126)
manifest
from chrome-extensions-samples.
Thanks for the fast reply, yes I have it there but it seems that messed up as tried different IDs.
Now I have:
App was not granted the "usbDevices" permission.
index.js:54 Object {message: "This function must be called during a user gesture"}
from chrome-extensions-samples.
I didn't modify the code at all, just change the vendor/productIDs.
The printer is found by chrome without any problems and I can print trough standard print dialog of chrome.
from chrome-extensions-samples.
I've just found that in chrome://settings/contentExceptions#plugins if I start the application I see that chrome automatically add block exception. Even if I manually add allow the block is still added on top. What can cause that?
from chrome-extensions-samples.
Related Issues (20)
- Kit-khat
- Can't call chrome.desktopCapture.chooseDesktopMedia from serviceWorker without target tab. HOT 1
- .github/CODE_OF_CONDUCT.md
- Chrome 121.0.6167.86 version have a bug some website line Some table lines are not aligned, chrome 120.x not have this BUG same code HOT 4
- How to open devTools after open a new tab? HOT 1
- continuous recording sample - allow user to select media stream tab or window ? HOT 1
- Manifest V3 declarativeNetRequest redirect sample is completely broken on latest chrome 121 HOT 11
- The Quick Start tutorial "quick-api-reference" sample doesn't work HOT 15
- Samples for chrome.management HOT 2
- Network preview tab override HOT 2
- How i can use extensions to hide maximize、minimize HOT 1
- Sample for chrome.types HOT 1
- Sample for chrome.desktopCapture
- Sample for chrome.offscreen HOT 1
- A CI to check for grammer mistake in the `.md` files HOT 8
- Adding a pull request template to the repository as like issue template HOT 2
- CEO
- Sample for chrome.commands API HOT 1
- Proposal: Enforce Node Version Rule and Prevent Modifications to package-lock.json
- I have a problem with the color of the tab page in the console HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-extensions-samples.