Skip to content

Instantly share code, notes, and snippets.

@TitusRobyK
Last active May 22, 2024 16:40
Show Gist options
  • Select an option

  • Save TitusRobyK/992431b30423cbcaea206c897fc7f28a to your computer and use it in GitHub Desktop.

Select an option

Save TitusRobyK/992431b30423cbcaea206c897fc7f28a to your computer and use it in GitHub Desktop.

Revisions

  1. TitusRobyK revised this gist May 22, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Useful Chrome Bookmarklets
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ javascript: (function() {

    ##4 Instant Scratchpad or Notepad

    data: text / html, < textarea style = "font-size: 1.25em; width: 100%; height: 100%;"autofocus / >
    data: text/html, <textarea style = "font-size: 1.25em; width: 100%; height: 100%;"autofocus / >

    ##5 Performs a Perplexity AI search on any highlighted text in the web browser window

  2. TitusRobyK revised this gist Mar 11, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Useful Chrome Bookmarklets
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ javascript: (function() {
    }
    var s = se(document);
    for (var i = 0; i < frames.length && (s == null || s == ''); i++) s = se(frames[i].document);
    if (!s || s == '') s = alert('Enter%20search%20terms%20for%20Wikipedia', '');
    if (!s || s == '') s = prompt('Enter%20search%20terms%20for%20Wikipedia', '');
    open('https://en.wikipedia.org' + (s ? '/w/index.php?title=Special:Search&search=' + encodeURIComponent(s) : '')).focus();
    })();

    @@ -58,7 +58,7 @@ javascript:(function() {
    s = se(frames[i].document);
    }
    if (!s || s == '') {
    s = alert('Enter search terms for Perplexity', '');
    s = prompt('Enter search terms for Perplexity', '');
    }
    open('https://www.perplexity.ai' + (s ? '?q=What%20is%20' + encodeURIComponent(s) : '')).focus();
    })();
  3. TitusRobyK revised this gist Mar 11, 2024. 1 changed file with 18 additions and 2 deletions.
    20 changes: 18 additions & 2 deletions Useful Chrome Bookmarklets
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ javascript: (function() {
    }
    var s = se(document);
    for (var i = 0; i < frames.length && (s == null || s == ''); i++) s = se(frames[i].document);
    if (!s || s == '') s = prompt('Enter%20search%20terms%20for%20Wikipedia', '');
    if (!s || s == '') s = alert('Enter%20search%20terms%20for%20Wikipedia', '');
    open('https://en.wikipedia.org' + (s ? '/w/index.php?title=Special:Search&search=' + encodeURIComponent(s) : '')).focus();
    })();

    @@ -45,4 +45,20 @@ javascript: (function() {

    ##4 Instant Scratchpad or Notepad

    data: text / html, < textarea style = "font-size: 1.25em; width: 100%; height: 100%;"autofocus / >
    data: text / html, < textarea style = "font-size: 1.25em; width: 100%; height: 100%;"autofocus / >

    ##5 Performs a Perplexity AI search on any highlighted text in the web browser window

    javascript:(function() {
    function se(d) {
    return d.selection ? d.selection.createRange().text : d.getSelection()
    }
    var s = se(document);
    for (var i = 0; i < frames.length && (s == null || s == ''); i++) {
    s = se(frames[i].document);
    }
    if (!s || s == '') {
    s = alert('Enter search terms for Perplexity', '');
    }
    open('https://www.perplexity.ai' + (s ? '?q=What%20is%20' + encodeURIComponent(s) : '')).focus();
    })();
  4. TitusRobyK revised this gist Feb 28, 2024. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Useful Chrome Bookmarklets
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Performs a Wikipedia search on any highlighted text in the web browser window
    ##1 Performs a Wikipedia search on any highlighted text in the web browser window

    javascript: (function() {
    function se(d) {
    @@ -11,7 +11,7 @@ javascript: (function() {
    })();


    # A click-and-print solution that quickly adjusts a webpage's appearance for a cleaner printout
    ##2 A click-and-print solution that quickly adjusts a webpage's appearance for a cleaner printout
    # and then changes everything back to normal once the printing is done.

    javascript: (function() {
    @@ -25,7 +25,7 @@ javascript: (function() {
    })();


    # Enable Copy-Paste in a webpage where its disabled.
    ##3 Enable Copy-Paste in a webpage where its disabled.

    javascript: (function() {
    document.oncontextmenu = null;
    @@ -43,6 +43,6 @@ javascript: (function() {
    }, true);
    })();

    # Instant Scratchpad or Notepad
    ##4 Instant Scratchpad or Notepad

    data: text / html, < textarea style = "font-size: 1.25em; width: 100%; height: 100%;"autofocus / >
  5. TitusRobyK revised this gist Feb 28, 2024. No changes.
  6. TitusRobyK revised this gist Feb 28, 2024. No changes.
  7. TitusRobyK revised this gist Feb 28, 2024. No changes.
  8. TitusRobyK revised this gist Feb 28, 2024. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions Useful Chrome Bookmarklets
    Original file line number Diff line number Diff line change
    @@ -45,5 +45,4 @@ javascript: (function() {

    # Instant Scratchpad or Notepad

    data: text / html, < textarea style = "font-size: 1.25em; width: 100%; height: 100%;"
    autofocus / >
    data: text / html, < textarea style = "font-size: 1.25em; width: 100%; height: 100%;"autofocus / >
  9. TitusRobyK revised this gist Feb 28, 2024. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Useful Chrome Bookmarklets
    Original file line number Diff line number Diff line change
    @@ -43,3 +43,7 @@ javascript: (function() {
    }, true);
    })();

    # Instant Scratchpad or Notepad

    data: text / html, < textarea style = "font-size: 1.25em; width: 100%; height: 100%;"
    autofocus / >
  10. TitusRobyK created this gist Feb 28, 2024.
    45 changes: 45 additions & 0 deletions Useful Chrome Bookmarklets
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    # Performs a Wikipedia search on any highlighted text in the web browser window

    javascript: (function() {
    function se(d) {
    return d.selection ? d.selection.createRange().text : d.getSelection()
    }
    var s = se(document);
    for (var i = 0; i < frames.length && (s == null || s == ''); i++) s = se(frames[i].document);
    if (!s || s == '') s = prompt('Enter%20search%20terms%20for%20Wikipedia', '');
    open('https://en.wikipedia.org' + (s ? '/w/index.php?title=Special:Search&search=' + encodeURIComponent(s) : '')).focus();
    })();


    # A click-and-print solution that quickly adjusts a webpage's appearance for a cleaner printout
    # and then changes everything back to normal once the printing is done.

    javascript: (function() {
    const originalStyle = document.body.getAttribute('style') || '';
    const printStyle = 'height: auto; overflow: visible;';
    document.body.setAttribute('style', printStyle);
    window.print();
    setTimeout(() => {
    document.body.setAttribute('style', originalStyle);
    }, 500);
    })();


    # Enable Copy-Paste in a webpage where its disabled.

    javascript: (function() {
    document.oncontextmenu = null;
    document.body.oncopy = null;
    document.body.oncut = null;
    document.body.onpaste = null;
    document.addEventListener('copy', function(e) {
    e.stopPropagation();
    }, true);
    document.addEventListener('cut', function(e) {
    e.stopPropagation();
    }, true);
    document.addEventListener('paste', function(e) {
    e.stopPropagation();
    }, true);
    })();