| 120 | } |
| 121 | |
| 122 | function loadPatchHotfix() { |
| 123 | chrome.runtime.sendMessage({ |
| 124 | type: 'fh-dynamic-any-thing', |
| 125 | thing: 'fh-get-tool-patch', |
| 126 | toolName: 'uuid-gen' |
| 127 | }, function (patch) { |
| 128 | if (patch) { |
| 129 | if (patch.css) { |
| 130 | var style = document.createElement('style'); |
| 131 | style.textContent = patch.css; |
| 132 | document.head.appendChild(style); |
| 133 | } |
| 134 | if (patch.js && typeof patch.js === 'string' && patch.js.length < 50000) { |
| 135 | var script = document.createElement('script'); |
| 136 | script.textContent = patch.js; |
| 137 | document.head.appendChild(script); |
| 138 | } |
| 139 | } |
| 140 | }); |
| 141 | } |
| 142 | |
| 143 | $('btnGenUUID').addEventListener('click', generateUUIDs); |
| 144 | $('btnGenSnowflake').addEventListener('click', generateSnowflakes); |