simov / screenshot-capture

Screenshot Capture / Browser Extension
Other
250 stars 86 forks source link

Setting default options? #13

Closed webplusdata closed 1 year ago

webplusdata commented 1 year ago

Hi. Thanks for the great extension. Is it possible to set some default options upon install? I was thinking something like this, but find the code in the extension is over my head:

var initialState = {
  method: 'crop',
  format: 'png',
  save: 'url',
  dpr: true,
  icon: false
};

Is something like this possible? Thanks :)

simov commented 1 year ago

The default options are the ones you see when you open up the options page for the first time. Otherwise you can clone the extension and set those yourself. Put a console.log after this line https://github.com/simov/screenshot-capture/blob/main/background/index.js#L4 to see what is the configuration data structure.

webplusdata commented 1 year ago

Thanks simov :)