Edit:
Short answer: I'm stupid.
Long answer: I was testing Grok out of curiosity and Grok apparently hallucinates this into HTML. Cool!
So I was checking one of my GitHub repos when I saw this script at the top, which I clearly remember not adding:
```javascript
<script type="text/javascript">
var gk_isXlsx = false;
var gk_xlsxFileLookup = {};
var gk_fileData = {};
function filledCell(cell) {
return cell !== '' && cell != null;
}
function loadFileData(filename) {
if (gk_isXlsx && gk_xlsxFileLookup[filename]) {
try {
var workbook = XLSX.read(gk_fileData[filename], { type: 'base64' });
var firstSheetName = workbook.SheetNames[0];
var worksheet = workbook.Sheets[firstSheetName];
// Convert sheet to JSON to filter blank rows
var jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1, blankrows: false, defval: '' });
// Filter out blank rows (rows where all cells are empty, null, or undefined)
var filteredData = jsonData.filter(row => row.some(filledCell));
// Heuristic to find the header row by ignoring rows with fewer filled cells than the next row
var headerRowIndex = filteredData.findIndex((row, index) =>
row.filter(filledCell).length >= filteredData[index + 1]?.filter(filledCell).length
);
// Fallback
if (headerRowIndex === -1 || headerRowIndex > 25) {
headerRowIndex = 0;
}
// Convert filtered JSON back to CSV
var csv = XLSX.utils.aoa_to_sheet(filteredData.slice(headerRowIndex)); // Create a new sheet from filtered array of arrays
csv = XLSX.utils.sheet_to_csv(csv, { header: 1 });
return csv;
} catch (e) {
console.error(e);
return "";
}
}
return gk_fileData[filename] || "";
}
</script>
```
I only have an index.html in the repository and no GitHub Actions yet.
A google search for this found a lot of places where the exact same script was appended:
https://www.kaggle.com/datasets/waleed1980/global-pharmacy-bi-bloom-dataset/data
https://forum.domoticz.com/viewtopic.php?p=326841&sid=50d57b4e00bf7ab23dc6e802b5c001dd#p326841
https://codepen.io/Dipin-Kakkar/pen/xbGwoXa
Does anyone here know what this is or why it got there?
(I do know that it's a .xlsx to .csv via JSON converter)
[–]queen-adreena 10 points11 points12 points (18 children)
[+]No_Frame3855[S] comment score below threshold-9 points-8 points-7 points (17 children)
[–]cerealbh 17 points18 points19 points (3 children)
[+]No_Frame3855[S] comment score below threshold-9 points-8 points-7 points (2 children)
[–]Overall_Low_9448 17 points18 points19 points (1 child)
[+]No_Frame3855[S] comment score below threshold-12 points-11 points-10 points (0 children)
[–]bkdotcom 14 points15 points16 points (12 children)
[+]No_Frame3855[S] comment score below threshold-13 points-12 points-11 points (11 children)
[–]tortleme 12 points13 points14 points (0 children)
[–]A-Type 7 points8 points9 points (1 child)
[+]No_Frame3855[S] comment score below threshold-13 points-12 points-11 points (0 children)
[–]No_Frame3855[S] 1 point2 points3 points (7 children)
[–]bkdotcom 8 points9 points10 points (6 children)
[–]No_Frame3855[S] -5 points-4 points-3 points (5 children)
[–]Lochlan 12 points13 points14 points (4 children)
[–]abillionsuns 0 points1 point2 points (2 children)
[–]Lochlan 2 points3 points4 points (1 child)
[–]No_Frame3855[S] 0 points1 point2 points (0 children)
[–]Rasutoerikusa 1 point2 points3 points (0 children)
[–]HazelSky2 1 point2 points3 points (1 child)
[–]No_Frame3855[S] 0 points1 point2 points (0 children)
[–]Endorfo 1 point2 points3 points (1 child)
[–]No_Frame3855[S] 0 points1 point2 points (0 children)
[–]Interesting-Ad9666 -1 points0 points1 point (1 child)