Skip to content

Instantly share code, notes, and snippets.

@webdevs-pro
Last active November 12, 2024 07:09
Show Gist options
  • Save webdevs-pro/02f332deccfbbeec71355cb218ba1f29 to your computer and use it in GitHub Desktop.
Save webdevs-pro/02f332deccfbbeec71355cb218ba1f29 to your computer and use it in GitHub Desktop.
Ferdium Notion receipt webview.js
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
const _path = _interopRequireDefault(require('path'));
module.exports = Ferdium => {
const getMessages = () => {
let direct = 0;
const badgeDiv = document.querySelector(
'.notion-sidebar-container .notion-sidebar span[style*="font-variant-numeric: lining-nums tabular-nums;"]',
);
if (badgeDiv) {
direct = Ferdium.safeParseInt(badgeDiv.textContent);
}
Ferdium.setBadge(direct);
};
Ferdium.loop(getMessages);
Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment