https://github.com/cr4fun/ChromeExtensionQRcode
其实,核心代码就一句话,而且是调用的 qrserver 的 api:
chrome.tabs.getSelected(null, function (tab) {
console.log(tab.url);
$('#qrcode').attr('src','https://api.qrserver.com/v1/create-qr-code/?size=150x150&data='+tab.url);
});