apply the headless-render work by @ahocevar in OL master