Skip to content

Instantly share code, notes, and snippets.

@botmtl
Last active May 7, 2024 06:50
Show Gist options
  • Save botmtl/94e4d26b2193a99591ae40c1c4f3f8ce to your computer and use it in GitHub Desktop.
Save botmtl/94e4d26b2193a99591ae40c1c4f3f8ce to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Literotica DatatableJS
// @namespace botmtl
// @description literotica sort/filter tables
// @match https://www.literotica.com/*
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.16/js/jquery.dataTables.min.js
// @resource customCSS https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.16/css/jquery.dataTables.css
// @grant GM_addStyle
// @grant GM_getResourceText
// ==/UserScript==
var newCSS = GM_getResourceText ("customCSS");
GM_addStyle (newCSS);
$(document).ready(function() {
t=document.querySelectorAll("body > div:nth-child(8) > div > table")[0];
t.insertAdjacentHTML('afterbegin', "<thead><tr><th>1</th><th>2</th><th>3</th><th>4</th></tr></thead>");
$('colgroup').remove();
$("body > div:nth-child(8) > div > table").DataTable({
rowGroup: true
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment