You can try the demo I've made.
It creates a zip with png files, associated pngw (world file) and prj files in a single zip when exporting.
The important part is for writing the pngw with below excerpt.
var currentResolution = view.getResolution();
var currentExtent = view.calculateExtent(); // Return [minx, miny, maxx, maxy]
var pngwContent = [
currentResolution,
0,
0,
-currentResolution,
currentExtent[0] + currentResolution / 0.5,
currentExtent[3] - currentResolution / 0.5
].join('\n');
Then, you open it in QGIS (It's possible without unzipping). It will ask you to choose the projection (in this demo, with EPSG code 3857)
The quick result I got for an overview in QGIS using Wikimedia base maps.
