Comments (5)
Well reason I asked for this is that I did fail to make it work in some simple case.
Like here create vanilla typescript project on codesandbox and added just your import example.
https://codesandbox.io/s/vibrant-euclid-hxfxz?file=/src/index.ts
Could be problem with how they package.
But neither it works on RunKit to which you can go from npm page.
https://npm.runkit.com/%40gripeless%2Fpico
So yeah I asked for some example project that has both code and published online to play around.
from pico.
It is a good idea!
from pico.
I don't know what frontend framework / library you're using, but in angular the implementation is dead simple:
- Install package:
npm install @gripeless/pico
- add Window to providers array in AppModule:
@NgModule({
declarations: [
// Components
AppComponent,
],
imports: [
//..
],
providers: [{ provide: Window, useValue: window }],
bootstrap: [AppComponent],
})
export class AppModule {}
- take a picture
import * as Pico from '@gripeless/pico';
@Injectable({
providedIn: 'root',
})
export class TicketService {
async doScreenShot() {
// ...
const screenshot = (await Pico.dataURL(window, {})).value;
console.log(screenshot ); // for debugging only
return screenshot;
}
}
If you don't know angular: It uses not normal javascript, but its superset typescript.
from pico.
Thanks for routing me to this example thread, unfortunately all examples are not working, resulting in "SyntaxError: Unexpected token" or "$csb__fluture.parallel is not a function".
from pico.
@JensUweB and what abotu the ignore option? Its failing if I provide { ignore: ['#to-ignore']}
from pico.
Can any kind soul provide me the minified js file of this library?
from pico.
Related Issues (16)
- Proxy failed CORS requests HOT 2
- Capture cursor position HOT 1
- New Feature: Please Provide Real World Example Usage HOT 1
- Some webfonts not working (only firefox) HOT 1
- Dependency future.js throwing an error
- Gripeless has been discontinued. HOT 2
- Safari support
- Inline `url()`'s in `style` attributes
- Option to ignore cloning certain nodes HOT 1
- Support running animations
- Subresource placeholders
- Same origin `<iframe>` rendering HOT 2
- Copy current `<video>` frame HOT 1
- Only download used font files
- Capture svg with href - link to a resource
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 pico.