Improve desktopCapturer api


#1

Hello,
I’m using desktopCapturer api in my electron app.
This works great, but unfortunately there is no way to add get window icon.
Yes, we having a window thumbnail, but for some functionality it will be great to get window icon.
So I decoded to add this feature to electron, but my c++ knowledge is to poor to do that, and only thing that i was able to do - add one more property

struct Converter<DesktopMediaList::Source> {
  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
                                   const DesktopMediaList::Source& source) {
    mate::Dictionary dict(isolate, v8::Object::New(isolate));
    content::DesktopMediaID id = source.id;
    dict.Set("name", base::UTF16ToUTF8(source.name));
    dict.Set("id", id.ToString());
    dict.Set("mainSource", source); // here
    dict.Set(
        "thumbnail",
        atom::api::NativeImage::Create(isolate, gfx::Image(source.thumbnail)));
    return ConvertToV8(isolate, dict);
  }
};

And modified some js files that is relative to this api, but app just crushes down
Sure that I’m doing something or everything wrong, so now requesting for help here