mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-15 21:00:02 +01:00
Merge branch 'headless-option-puppeteer' of github.com:publiclab/image-sequencer into headless-option-puppeteer
This commit is contained in:
@@ -201,15 +201,17 @@ var sequencer = ImageSequencer();
|
||||
### Loading an Image into the Sequencer
|
||||
|
||||
The `loadImage` method is used to load an image into the sequencer. It accepts
|
||||
a name and an image. The method also accepts an optional callback.
|
||||
an image `src`, either a URL or a data-url. The method also accepts an optional callback.
|
||||
|
||||
```js
|
||||
sequencer.loadImage(image_src,optional_callback);
|
||||
sequencer.loadImage(image_src, optional_callback);
|
||||
```
|
||||
|
||||
On `Node.js` the `image_src` may be a DataURI or a local path or a URL.
|
||||
|
||||
On browsers, it may be a DatURI, a local image or a URL (Unless this violates
|
||||
CORS Restrictions). To sum up, these are accepted:
|
||||
|
||||
* Images in the same domain (or directory - for a local implementation)
|
||||
* CORS-Proof images in another domain.
|
||||
* DataURLs
|
||||
@@ -219,7 +221,7 @@ The callback is called within the scope of a sequencer. For example:
|
||||
(addSteps is defined later)
|
||||
|
||||
```js
|
||||
sequencer.loadImage('SRC',function(){
|
||||
sequencer.loadImage('SRC', function(){
|
||||
this.addSteps('module-name');
|
||||
});
|
||||
```
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = function runInBrowserContext(input, callback, step, options) {
|
||||
|
||||
var obj = { input: input, modOptions: minOptions }
|
||||
|
||||
puppeteer.launch().then(function(browser) {
|
||||
puppeteer.launch({headless: true, args:['--no-sandbox']}).then(function(browser) {
|
||||
browser.newPage().then(page => {
|
||||
/* Maybe there is a better way to this, loading the page coz localstorage API
|
||||
is not available otherwise */
|
||||
@@ -34,4 +34,4 @@ module.exports = function runInBrowserContext(input, callback, step, options) {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user