Skip to content

Instantly share code, notes, and snippets.

@pourmand1376
Last active May 6, 2026 21:05
Show Gist options
  • Select an option

  • Save pourmand1376/b5ecc280c72641febd1055d192f333d0 to your computer and use it in GitHub Desktop.

Select an option

Save pourmand1376/b5ecc280c72641febd1055d192f333d0 to your computer and use it in GitHub Desktop.
My Custom TamperMonkey Config for Motamem
// ==UserScript==
// @name Motamem Custom UI
// @namespace http://tampermonkey.net/
// @version 1.4
// @description Add reading links + remove sidebar
// @match https://motamem.org/*
// @run-at document-end
// @grant none
// ==/UserScript==
(function() {
'use strict';
const isHome = window.location.pathname === "/" || window.location.pathname === "";
// ✅ 1. Add reading links ONLY on homepage
if (isHome) {
const box = document.createElement("div");
box.style.position = "fixed";
box.style.top = "10px";
box.style.right = "10px";
box.style.background = "#fff";
box.style.padding = "10px";
box.style.border = "1px solid #ccc";
box.style.zIndex = "9999";
box.style.fontSize = "14px";
const links = [
{
url: "https://motamem.org/%d8%aa%d8%b9%d8%b1%db%8c%d9%81-%d8%b3%db%8c%d8%b3%d8%aa%d9%85-%d9%be%db%8c%da%86%db%8c%d8%af%d9%87/",
text: "📚 سیستم‌های پیچیده"
},
{
url: "https://motamem.org/%D8%B3%D8%B1%DB%8C-%D8%A7%D8%B5%D9%88%D9%84-%D9%88-%D9%81%D9%86%D9%88%D9%86-%D9%85%D8%B0%D8%A7%DA%A9%D8%B1%D9%87/",
text: "🏠 مذاکره "
},
{
url: "https://motamem.org/%D8%AF%D8%B1%D8%B3-%D8%AA%D8%B5%D9%85%DB%8C%D9%85-%DA%AF%DB%8C%D8%B1%DB%8C-%D9%BE%DB%8C%D8%B4%D8%B1%D9%81%D8%AA%D9%87-%D9%86%D9%82%D8%B4%D9%87-%D8%B1%D8%A7%D9%87-%D8%AF%D8%B1%D8%B3/"
, text: "تصمیم گیری پیشرفته"
},
{
url: "https://motamem.org/%D8%AA%D9%81%DA%A9%D8%B1-%D9%86%D9%82%D8%A7%D8%AF%D8%A7%D9%86%D9%87-critical-thinking/",
text: "تفکر نقادانه"
}
];
links.forEach(item => {
const a = document.createElement("a");
a.href = item.url;
a.textContent = item.text;
a.style.display = "block";
a.style.marginBottom = "5px";
a.style.color = "blue";
box.appendChild(a);
});
document.body.appendChild(box);
}
// ✅ 2. Remove sidebar on NON-home pages
if (!isHome) {
const sidebar = document.getElementById("sidebar-primary");
if (sidebar) {
sidebar.remove();
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment