Skip Navigation
There are now close to 10 iOS / Android apps in development for kbin & lemmy!
  • Zero idea. Never worked on Android apps myself.

  • which OS do you like the most?
  • Following my message I tried to dual boot. Turns out my laptop is incompatible with default Nvidia drivers and my screen stopped working with it so after days of research and trying again, I had to go back to Windows, just to get the big monitor to have display.

  • i never knew
  • Shit my dude

  • Defederation from Lemmygrad.ml
  • Huh I may have forgotten neurotypicals can do multiple things in one day šŸ˜‚šŸ˜­šŸ˜‚

  • Defederation from Lemmygrad.ml
  • Well, most of the time if you're gonna vote you wanna be aware of what you're voting for beyond "lemmy told me Sandra Buttocks is super cool and against electric guillotines for the poor". Takes some time to evaluate people, parties and ideas properly. I was kind of obsessed with that "evaluation", thought it was productive. Going to protests, being one in the hive, realized later I hadn't built a life and a career that would support me well. Swapped my priorities and now I earn well as a software engineer, am building a new life I thought wasn't possible for my family, moved them to another county instead of trying to replace the dictators cuz that's less realistic. Simple shit that builds up. Want free healthcare? Move to free healthcare. More efficient than crying for it and becoming bankrupt.

  • Defederation from Lemmygrad.ml
  • You're statistically more likely to advance your own interests through direct action than by being one of hundreds of millions of voters. Licking the boot of the lesser of two evils is less productive than focusing on building the environment you want.

  • Tesla Buys German Railway Line to Host Passenger Trains at Gigafactory
  • These trains will be free for all passengers. And probably paid by the company

  • Tolerating intolerance
  • You may have not read much.

  • Finally seriously looking at [#Obsidian](https://pkm.social/tags/Obsidian) Sync.
  • Do check if all files are synced. Years ago I tried sync and I lost all my pdfs. Only mds and images were shared.

  • Why do you use firefox?
  • Containers addon. And it has bookmarks decades old. Remove both and I wouldn't care much. I'm also more familiar with it. It feels more natural due to this. I feel more comfortable on it. More at home, less scared.

  • Anyone else playing on a 5-20 year lag?
  • Had it replaced. All good now!

  • Zelensky dismisses compromise with Putin, pointing to Prigozhinā€™s death
  • "my genociders are good, your genociders are bad". Whataboutism at its best. Lovely.

  • Anyone else playing on a 5-20 year lag?
  • Sadly my laptop is making weird noises. Brrrrrrrrrrhrhrhrhrhrhrhrrtrtrtrtrtttrtr. I think the fan is filled with dust. But I don't know how to open it without breaking it so I haven't done it. I'm in pain.

  • Does Consciousness Disappear in Dreamless Sleep?
  • I think this is false but I don't have information to refute it other than my own experience. I used to write a dream diary. When I did, I remembered my dreams almost every time I woke up. Not just half the time or 80% but more like 96% of the time. And it was very detailed with multiple dreams tied to each other.

  • Anyone else playing on a 5-20 year lag?
  • by deus ex do you mean this one or some other installment? https://fitgirl-repacks.site/deus-ex-mankind-divided/

  • Welcome to the Olympus for Lemmy Community!

    cross-posted from: https://sh.itjust.works/post/518117

    > I'm creating this community as a place for discussion around the upcoming Olympus for Lemmy iOS app. The TestFlight build is awaiting approval and should be available in the next 24 hours. In the meantime, here's a bit about the app and what to expect. > > # Motivation > I think a lot of us have an alien shaped hole in our chest that needs filling. I, like many of you, was not satisfied with the quality of many of the apps available for browsing lemmy. I got spoiled with Apollo and couldn't stand to settle, so I set out to build a similar experience for the Fediverse. While I've taken a lot of inspiration from Apollo, Olympus is by no means meant to be a direct clone. > > # Goal > I want to create a browsing experience that can be customized in every conceivable way. From visual personalization to content filtering, you will be able to change as much as is feasible about the app. > A lot of the groundwork for this customization has been laid, but the settings are not yet user-accessible. In other words, the backed work is done but the frontend work is not(: > > # Where you come in > As early adopters and alpha testers, you all will play a pivotal role in the development of the app. Whatever you want, I'll do it. Just ask. I have an issue tracker set up on GitHub here, please stop by and drop any issues you face in there, or just make a post here. I'd prefer if we keep feature requests in this community and out of the issue tracker, but I won't be mad if you drop some in there too. > > So that about sums it up I think. I'll keep you guys posted on new releases and will engage with you all in the comments. > > - Joe

    0
    The drop pod in the game Deep Rock Galactic has a face.

    The drop pod is what you use to drop from the space rig into the planet Hoxxes to start a mission, and you also use it to fly back up to the space rig with your loot.

    0
    There are now close to 10 iOS / Android apps in development for kbin & lemmy!

    cross-posted from: https://kbin.social/m/kbinMeta/t/71764

    link to post: https://sh.itjust.works/post/311799

    > The amount of apps being developed for iOS / Android is getting really crazy now and new apps keep popping up every day. Updated list below: > > * Artemis (Kmoon) (iOS, Android): /c/ArtemisApp@kbin.social > * Memmy (iOS, Android): /c/memmy@lemmy.ml > * Mlem (iOS - TestFlight): /c/mlemapp@lemmy.ml > * Morpha (iOS, Android): /c/morpha@vlemmy.net > * Thunder (iOS, Android): /c/thunder\_app@lemmy.world > * Beyond (iOS, Android): https://beehaw.org/post/647773 > * Liftoff (FOSS) (iOS/Android, Download on GitHub & on TestFlight): /c/liftoff@lemmy.world > * Jerboa (Android - Released): (Play Store) https://github.com/dessalines/jerboa > * Slide (Android): https://lemmy.world/post/379068 > * Sync (Android): /c/syncforlemmy@lemmy.world > * Connect (Android - Beta): https://beehaw.org/post/698247 > * Lemon (iOS): https://lemm.ee/post/127800 > * Summit (Android - Released): https://play.google.com/store/apps/details?id=com.idunnololz.summit > > Most apps on the list are lemmy apps, meaning they don't work with kbin. Artemis is specifically designed to work with kbin, not sure if or when any of the other ones will go in that direction or become interoperable as there are some challenges with the kbin API at the moment. Having said that, a new API is in the works so things should get better with time.

    I made a neat table, here u go:

    Click to see table

    | Name | Platform | OS | Stage | Link | |-------------------|------------------------------|-------------|-------------------------------------------------|------------------------------------------------------------------------------------------| | Artemis (Kmoon) | Kbin, Lemmy (Upcoming) | Android, iOS | Private Beta (Starts End of June) | /c/ArtemisApp@kbin.social | | Memmy | Lemmy | Android, iOS | Android Release (Pending Play Store Approval) | /c/memmy@lemmy.ml | | Mlem | Lemmy | iOS | Submitted for App Store Review (July 1) | /c/mlemapp@lemmy.ml | | Morpha | Lemmy | Android, iOS | Under Development | /c/morpha@vlemmy.net | | Thunder (FOSS) | Lemmy | Android, iOS | Alpha Release | [Thunder on GitHub] [Thunder Community] | | Beyond | Lemmy | Android, iOS | Under Development | Beyond on Lemmy | | Limbo | Lemmy | iOS | TestFlight Beta | Join the Limbo for Lemmy beta on iOS | | Jerboa | Lemmy | Android | Released | Jerboa on GitHub | | Slide | Lemmy | Android | Under Development (More information coming) | Slide on Lemmy | | Sync | Lemmy | Android | Research | /c/syncforlemmy@lemmy.world | | Liftoff (FOSS) | Lemmy | Android | Under Development | Liftoff | | Connect | Lemmy | Android | Beta | [Connect Release Post], [Connect Community] | | Lemon | Lemmy | iOS | Development, Beta in Early July | Lemon Introduction, Lemon Community | | Summit | Lemmy | Android | Released | Summit on Google Play, Summit Demo Video |

    18
    Free eBooks @sh.itjust.works God @sh.itjust.works
    All of Lovecraft's books, download for free on Project Gutenberg
    www.gutenberg.org Books by Lovecraft, H. P. (Howard Phillips) (sorted by popularity)

    Project Gutenberg offers 71,073 free eBooks for Kindle, iPad, Nook, Android, and iPhone.

    List & dates by ChatGPT

    • The call of Cthulhu (1928)
    • Medusa's coil (1939)
    • The curse of Yig (1928)
    • At the mountains of madness (1931)
    • The colour out of space (1927)
    • The Dunwich Horror (1929)
    • The Shunned House (1928)
    • The lurking fear (1923)
    • The festival (1923)
    • The last test (1928)
    • The silver key (1926)
    • Writings in the United Amateur, 1915-1922 (1923)
    • He (1926)
    0
    How do you get a better front page on Lemmy without so much old stuff?

    I find that Hot and Active give you really old stuff, at least on my instance, that's like 3-7 days old stuff. New is just new, you know new, no community-assured quality. Top is stuff I've already seen. Where do I get a better feed? Can we have like Top 7 hours? Or a mixture of "top 16 hours" and "active"?

    What do you do when browsing Lemmy? What are some of your strategies to get good shit while being here? Cuz so far if I try and use the front pages I get bored to shit.

    The way I get anything barely worth interacting with from the front page is New Comments. Not the best, but better than the other options I discussed.

    That or just, instead of interacting with a lot of stuff, interacting deeply with the few things I find that I like.

    5
    [Custom CSS] Some overrides to make Lemmy a little bit more pleasant to use. by @teacherbuknoy@lemmyworld

    author:

    Preview:

    !

    • Style: https://userstyles.world/style/10345/lemmy-world
    • Source: https://masto.ai/@teacherbuknoy/110543779636316075
    0
    [Userscript] Hover Cards for users, get info without opening their profile

    Wanted to do this for a while. Did it today instead of sleeping.

    Screenshot:

    !

    You can install it from here: https://greasyfork.org/en/scripts/468948-user-details-on-hover

    Link to GitHub repo: https://github.com/lemmygod/lemmy-hovercards/tree/main

    Or you can copy-paste the following code:

    click here to view code.

    ```js // ==UserScript== // @name User Details on Hover // @namespace http://tampermonkey.net/ // @version 0.12 // @description Show user details on hover // @author You // @match :///* // @grant none // ==/UserScript==

    (function () { "use strict"; const isLemmy = document.head.querySelector("[name~=Description][content]").content === "Lemmy"; if (!isLemmy) return; // Inject styles for the user card function main() { const style = document.createElement("style"); style.innerHTML = ` .user-card { position: absolute; display: none; width: 350px; background-color: #242424; color: white; padding: 15px; border-radius: 10px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1000; grid-gap: 10px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.4; }

    .user-card .header { display: flex; align-items: center; margin-bottom: 10px; }

    .user-card img { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; margin-right: 15px; }

    .user-card .username { font-size: 1.3em; font-weight: bold; }

    .user-card .instance { font-size: 0.8em; color: #888; }

    .user-card .body { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; }

    .user-card .key { font-weight: bold; }

    .user-card .value { color: #ddd; margin-top: 10px; }

    .user-card .bio { grid-column: 1 / -1; font-style: italic; }`; document.head.appendChild(style);

    // Create the user card const userCard = document.createElement("div"); userCard.classList.add("user-card"); userCard.id = "user-card"; document.body.appendChild(userCard);

    let timer; // Find all user links const userLinks = document.querySelectorAll('a.text-info[href*="/u/"]'); userLinks.forEach((userLink) => { userLink.setAttribute("title", ""); // When mouse enters, show the user card userLink.addEventListener("mouseenter", async (event) => { const username = userLink.href.split("/u/")[1];

    // Fetch user details const userInfo = await getUserInfo(username);

    // Format the date const date = new Date(userInfo.creationDate); const formattedDate = ${date.getFullYear()}/${String( date.getMonth() + 1 ).padStart(2, "0")}/${String(date.getDate()).padStart(2, "0")};

    // Update the user card userCard.innerHTML = <div class="header"> <img src="${ userInfo.profilePicture || https://api.dicebear.com/6.x/identicon/svg?seed=${username} }" alt="User avatar"> <div> <div class="username">${ userInfo.name || username.split("@")[0] }</div> <a href="https://${ userInfo.instance }/u/${username}" class="instance">${username}${ username.indexOf("@") === -1 ? "@" + userInfo.instance : "" } </a> </div> </div> <div class="body"> <div><span class="key">ID:</span> <span class="value">${ userInfo.id }</span></div> <div style="display:flex; flex-direction: column; gap: 3px"><span class="key"> <svg class="icon"><use xlink:href="/static/assets/symbols.svg#icon-cake"></use><div class="sr-only"><title>cake</title></div></svg> Cake Day:</span> <span class="value">${formattedDate}</span></div> <div><span class="key">Posts:</span> <span class="value">${ userInfo.post_count }</span></div> <div><span class="key">Comments:</span> <span class="value">${ userInfo.comment_count }</span></div> <div><span class="key">Post Score:</span> <span class="value">${ userInfo.post_score }</span></div> <div><span class="key">Comment Score:</span> <span class="value">${ userInfo.comment_score }</span></div> ${ userInfo.bio ?<div class="bio">${userInfo.bio}</div> : "" } </div>;

    // Show the user card at the cursor const rect = userLink.getBoundingClientRect(); userCard.style.left = ${window.pageXOffset + rect.left}px; userCard.style.top = ${window.pageYOffset + rect.bottom + 5}px; // setTimeout(() => { if (userLink.querySelector(":hover")) { userCard.style.display = "block"; } // }, 250); timer = setTimeout(() => { // check if username is not being hovered anymore after 150ms, after which point we must change display to none if (!userLink.querySelector(":hover")) { userCard.style.display = "none"; } }, 150); });

    // When mouse leaves, hide the user card after a slight delay userLink.addEventListener("mouseleave", () => { // after a slight delay, delete the node timer = setTimeout(() => { // delete the node // userCard.parentElement.removeChild(userCard); userCard.style.display = "none"; }, 250); setTimeout(() => { // check if both are unhovered after 260ms, and if that's the case, removeChild anyway if (!userCard.parentElement) return; if (!userCard.querySelector(":hover")) { // userCard.parentElement.removeChild(userCard); userCard.style.display = "none"; } }, 250);

    // timer = setTimeout(() => { // userCard.style.display = "none"; // }, 250); }); });

    userCard.addEventListener("mouseenter", () => { clearTimeout(timer); });

    userCard.addEventListener("mouseleave", () => { userCard.style.display = "none"; // userCard.parentElement.removeChild(userCard); });

    // Fetch user info from the API async function getUserInfo(userName) { const instanceName = location.href.split("/")[2]; const response = await fetch( https://${instanceName}/api/v3/user?username=${userName}, { method: "GET", headers: { "Content-Type": "application/json", }, } ); const user = await response.json(); const { published: creationDate, avatar: profilePicture, bio, display_name: name, name: username, id, banner, } = user.person_view.person; const { comment_count, comment_score, post_count, post_score } = user.person_view.counts;

    return { creationDate, profilePicture, bio, name, username, id, banner, instance: instanceName, comment_count, comment_score, post_count, post_score, }; } }

    // detect react changed url but didn't reload the page by checking for url change var oldHref = document.location.href; setInterval(function () { if (document.location.href !== oldHref) { oldHref = document.location.href; // Wait for the page to load setTimeout(main, 1000); console.log("url changed!"); } }, 500);

    // run on page load main(); })(); ```

    0
    Lemmy Plugins & Userscripts | Personalize and enhance the Lemmy user interface, post and find ways to browse Lemmy more comfortably
    sh.itjust.works Lemmy Plugins & Userscripts - sh.itjust.works

    A general repository for user scripts and plugins used to enhance the Lemmy browsing experience. Post (or cross-post) your favorite Lemmy enhancements here! General posting suggestions: - Preface the submission with the type of enhancement - ex: [UserScript]. - Include a screenshot of the enhancemen...

    Lemmy Plugins & Userscripts - sh.itjust.works

    Universal link to the community: /c/plugins

    The Lemmy UI is under development and more improvements are coming everyday, but while we wait, we're making userscripts and plugins to improve our experience.

    If you're a user, feel free to just come in and use the scripts.

    If you're a developer, we invite you to try and help make the experience of newcomers (and oldcomers) better.

    1
    How to Install UserScripts: A Comprehensive Guide for Chrome and Firefox (Guide by ChatGPT)

    Table of Contents

    1. Introduction
    2. What is a UserScript?
    3. Installing a UserScript Manager
      • Installing Tampermonkey on Chrome
      • Installing Violentmonkey on Chrome
      • Installing Tampermonkey on Firefox
      • Installing Greasemonkey on Firefox
      • Installing Violentmonkey on Firefox
    4. Adding a UserScript
    5. Conclusion

    Introduction

    UserScripts are an incredible way to enhance and customize your browsing experience. They allow you to alter the functionality and layout of web pages, like Lemmy UI, by executing JavaScript codes on the client side. In this guide, we'll walk you through the process of installing UserScripts in your Chrome or Firefox browser.

    What is a UserScript?

    UserScripts are bits of code written in JavaScript that run in your web browser. They can modify the content, layout, and behavior of web pages. The true power of UserScripts lies in their ability to tailor your browsing experience to your needs.

    Installing a UserScript Manager

    To run UserScripts, you'll need to install a UserScript manager extension. Two popular ones are Tampermonkey and Greasemonkey.

    Installing Tampermonkey on Chrome

    1. Open the Chrome web browser.
    2. Go to the Tampermonkey page on the Chrome Web Store.
    3. Click the "Add to Chrome" button.
    4. Confirm by clicking "Add extension" in the pop-up window.

    Installing Violentmonkey on Chrome

    1. Open the Chrome web browser.
    2. Go to the Violentmonkey page on the Chrome Web Store.
    3. Click the "Add to Chrome" button.
    4. Confirm by clicking "Add extension" in the pop-up window.

    Installing Tampermonkey on Firefox

    1. Open the Firefox web browser.
    2. Go to the Tampermonkey page on the Firefox Add-ons site.
    3. Click the "Add to Firefox" button.
    4. Confirm by clicking "Add" in the pop-up window.

    Installing Greasemonkey on Firefox

    1. Open the Firefox web browser.
    2. Go to the Greasemonkey page on the Firefox Add-ons site.
    3. Click the "Add to Firefox" button.
    4. Confirm by clicking "Add" in the pop-up window.

    Installing Violentmonkey on Firefox

    1. Open the Firefox web browser.
    2. Go to the Violentmonkey page on the Firefox Add-ons site.
    3. Click the "Add to Firefox" button.
    4. Confirm by clicking "Add" in the pop-up window.

    Adding a UserScript

    Now that you have a UserScript manager installed, you can add your own scripts. Here's how:

    1. Click on the Tampermonkey or Greasemonkey icon in your browser toolbar.
    2. Choose "Create a new script..." from the dropdown menu.
    3. You'll be taken to a new tab with a script template. Delete this template.
    4. Copy your UserScript and paste it into the empty field.
    5. Click "File" and then "Save" in the editor menu.

    That's it! Your UserScript is now installed and will run on the sites specified in its metadata.

    Conclusion

    UserScripts offer an incredible way to customize your web browsing experience. Whether you're using Chrome or Firefox, Tampermonkey, Greasemonkey or Violentmonkey, you can create a browsing environment that's uniquely suited to your needs. Happy scripting!

    Remember, while UserScripts are powerful tools, they should be used responsibly. Don't install scripts from sources you don't trust, as they can pose security risks. Always review the code of a UserScript before installing it to ensure it doesn't contain anything malicious.

    2
    [Userscript] Unblur NSFW content

    Credits: source

    | Change | Source | Author | | ------------------------ | ------------------------------------ | -------------------------------------- | | Original CSS | comment#610 | ___ | | Original userscript | comment#902 | yay | | Userscript URL fix | comment#2219 | god | | Final / Affects player size | comment#21062 | FreePussy4All |

    original css: by https://lemmynsfw.com/u/___

    original userscript: https://lemmynsfw.com/comment/610 by my tiny fix: me

    script:

    ``` // ==UserScript== // @name lemmynsfw no blur and embed size tweak // @version 1.2 // @description unblur // @match https://lemmynsfw.com/* // @match https:///c/@lemmynsfw.com // @grant GM_addStyle // @run-at document-start // ==/UserScript==

    GM_addStyle( .img-blur { filter: none !important; -webkit-filter: none !important; -moz-filter: none !important; -o-filter: none !important; -ms-filter: none !important; } div.post-listing > iframe { width: 100%; height: 26rem; }); ```

    0
    [Userscript] Redirect another instance's commmunity to your local instance

    Original post, containing the original code @soy@lemmy.world made: https://sh.itjust.works/post/33762

    his original message:

    > For those that use Tampermonkey or GreaseMonkey, hereā€™s a quick script I whipped up that creates a button that redirects communities from other instances to your local instance. If your instance isnā€™t lemmy.world, then change the localLemmy var at the top. Enjoy!

    My small fix:

    For personal use, I changed localLemmy to sh.itjust.works because that's my instance. I also embedded some styles and made it so it's top right instead of bottom left, and so that it's red and works better for me. Soy's original code didn't work for me so I had to make these small alterations to get it working.

    ``` // ==UserScript== // @name Lemmings Fix // @version 1.0 // @description Redirect to your local Lemmy instance // @author @lemmy.world/u/soy // @match https:///c/ // @icon https://join-lemmy.org/static/assets/icons/favicon.svg // ==/UserScript==

    const localLemmy = "sh.itjust.works"; var isLemmy = document.head.querySelector("[name~=Description][content]").content === "Lemmy";

    if (isLemmy) { // Get URL info var splitUrl = location.href.split("/"); var instanceUrl = splitUrl[2]; var community = splitUrl[4]; var localizedUrl = "https://" + localLemmy + "/c/" + community + "@" + instanceUrl;

    // Create redirect button if not on local if (instanceUrl !== localLemmy) { var zNode = document.createElement("div"); zNode.innerHTML = "Open in local instance"; zNode.setAttribute("id", "localizeContainer"); // add styles to the button embedded zNode.setAttribute( "style", "cursor: pointer; padding: 16px; background-color: red; border-radius: 10%; border-width: 3px; border-style: solid; padding: 3px; z-index: 10;max-width:200px;position:fixed;top:0;right:0;" ); zNode.addEventListener("click", onLocalize); document.body.appendChild(zNode); } }

    function onLocalize() { window.location.replace(localizedUrl); } ```

    2
    [Userscript] Submit posts & comments with Ctrl + Enter

    Clarifications

    1. This works most of the time. Sometimes it doesn't. Needs a bit more testing.
    2. the new version of Lemmy (link to PR) will have a few shortcuts, and this userscript will be deprecated. But until then, I will keep using it.

    Original post:

    cross-posted from: https://sh.itjust.works/post/42893

    > Decided to make a little script that listens to textareas in post & comments, and if you press Ctrl Enter while focusing on them, it submits them. I use this to post comments faster and with less bother. It's reminiscent of the RES feature to do the same thing. > > If you use Greasemonkey or Tampermonkey, you can install this easily and instantly have CtrlEnter to submit. Let me know any improvements I can make. > > js > // ==UserScript== > // @name Lemmy Form Submit with Ctrl+Enter > // @version 1.0 > // @description Submit forms with Ctrl+Enter in Lemmy instances so you don't have to click the button every time you want to post something. > // @author God (https://sh.itjust.works/u/god) > // @match https://*/post/* > // @match https://*/comment/* > // @icon https://join-lemmy.org/static/assets/icons/favicon.svg > // ==/UserScript== > > var isLemmy = > document.head.querySelector("[name~=Description][content]").content === > "Lemmy"; > > if (isLemmy) { > // Define a global variable to keep track of the currently focused textarea. > var currentFocusedTextarea = null; > > // Function to attach focus and blur event handlers to all textareas. > function attachEventHandlers() { > document.querySelectorAll("textarea").forEach((textarea) =&gt; { > if (!textarea.dataset.ctrlEnterHandled) { > textarea.dataset.ctrlEnterHandled = true; > > // Check if this textarea is currently focused > const wasFocused = document.activeElement === textarea; > > textarea.addEventListener("focus", function () { > currentFocusedTextarea = this; > }); > > textarea.addEventListener("blur", function () { > currentFocusedTextarea = null; > }); > > // If this textarea was focused, blur and re-focus it to ensure event handlers get triggered > if (wasFocused) { > textarea.blur(); > textarea.focus(); > } > } > }); > } > > // Attach a keydown event handler to the entire document. > document.addEventListener("keydown", function (event) { > // If Ctrl + Enter is pressed > if (event.ctrlKey &amp;&amp; event.key === "Enter") { > // If a textarea is focused and contains text > if ( > currentFocusedTextarea &amp;&amp; > currentFocusedTextarea.value.trim() !== "" > ) { > // Your submit logic here > handleSubmit(currentFocusedTextarea); > } > } > }); > > function handleSubmit(textarea) { > // find the closest type="submit" button and press it. > textarea.closest("form").querySelector('[type="submit"]').click(); > } > > // Call the function initially to cover textareas that exist when the page is first loaded. > attachEventHandlers(); > > // Observe the document for changes and reattach event handlers when new textareas are added. > const observer = new MutationObserver(function (mutations) { > mutations.forEach((mutation) =&gt; { > if (mutation.type === "childList") { > attachEventHandlers(); > } > }); > }); > > observer.observe(document.body, { childList: true, subtree: true }); > } >

    0
    god God @sh.itjust.works

    Stirnerian Egoist looking for self satisfaction. Gimme Chinese xianxia novels and romantic K-dramas please.

    Posts 26
    Comments 114
    Moderates