Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,28 @@ <h1>💩 Bullshit.js</h1>
<p>Bullshit.js is a best-of-breed, mission-critical enterprise JavaScript bookmarklet that will empower you to evaluate the high impact of market-driven text on any Web resource, cultivating process-centric innovation and out-of-the-box thinking.</p>
<p>To use it, drag the following link to your bookmarks bar and use it on any page to leverage our innovative translation service:</p>
<p><a class="reveal" href="javascript:(function(){var d=document,s=d.createElement('script');s.crossOrigin='anonymous';s.src='https://unpkg.com/@mourner/bullshit@1.3.0/bullshit.js';d.body.appendChild(s);}())">Reveal Bullshit</a></p>
<p><label><input type="checkbox" id="csp-checkbox"> CSP friendly-version</label></p>
<p>Please help us engage our customers by contributing to the <a href="https://github.com/mourner/bullshit.js/blob/master/src/terms.js">dictionary</a>.</p>
<p><a class="github-button" href="https://github.com/mourner/bullshit.js" data-size="large" data-show-count="true" aria-label="Star mourner/bullshit.js on GitHub">Star</a></p>

<script>
const revealEl = document.querySelector('.reveal');
const originalHref = revealEl.href;
const checkboxEl = document.querySelector('#csp-checkbox');
let cachedData;

checkboxEl.addEventListener('change', async () => {
if (checkboxEl.checked) {
if (!cachedData) {
const response = await fetch(originalHref.match(/s\.src='(.+?)'/)[1]);
cachedData = await response.text();
}
revealEl.href = 'javascript:' + cachedData + ';void(0)';
} else {
revealEl.href = originalHref;
}
});
</script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</main></body>
</html>