![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://lemmy.world/pictrs/image/fe882c27-7ec3-429e-a086-03d5a3efb517.png)
10 acres i just bought
Congrats!
10 acres i just bought
Congrats!
Hmm, I’m not sure what’s going on there. Can’t seem to replicate. Which OS? I tested on Ubuntu, Windows, and an old Chromebook.
Can you try swapping it for a console.log instead of alert? I figure there’s a small chance that it’s a ‘user agent intervention’ where it hides the alert due to it seeming like a spammy thing.
(Note that Perchance is actually a platform for creating generators/applications, and it sounds like you’re talking about one particular generator, made by one particular user - namely perchance.org/ai-character-chat - in this case I happen to be that ‘user’. This is just a heads up because a lot of people who land here think that perchance is an AI chat site or whatever. It’s actually a platform where anyone can create random generators, and other things like AI chat applications)
it just… Goes “stupid”?
when I make more advanced AIs it tells me they can’t access websites or show me the contents.
it’ll run through the Lore Querying then it doesn’t provide its “Generated Response” in regards to the facts in the Lores.
I can probably fix all of these things, but I need example threads where they happened. If any of them happen again and if you’re able to share (in reply here, or via DM) a snapshot of a thread using this save button:
then I should be able to work out what’s happening and fix it. Without example threads, it’s really hard for me to fix stuff like this. But the moment someone gives me an example thread/export, or an easy way to consistently reproduce the issue, I can usually fix/improve it really fast.
This Generator Has Errors
Are you able to explain the steps I can take to reproduce this error? I just created a character, and added some example lore, and saved it, and it seems to work fine, so it might be related to some settings in your character, or something like that. If you’re not able to reliably reproduce it (i.e. it happens randomly), then another helpful thing would be to click that “this generator has errors” notice and copy/screenshot the error message that is shown.
Seems to be working fine for me in both cases - i.e. I see “loaded” alert when I load the page with and without #edit
at the end of the URL. Can you give more details? I’ve tested in Chrome and Firefox.
Thanks!
I’ve hackily fixed <a href="#foo">foo</a>
clicks so they work properly now.
I’ve also added a fix so if you visit perchance.org/whatever#foo it’ll correctly try to scroll to the id="foo"
element if it exists: https://perchance.org/dkp9npcidc#foo - pinging @VioneT@lemmy.world
You can also type a hash into the address bar of an already loaded page and press enter, and it’ll scroll to the element, like a normal top-level page does.
I’ve also fixed history.replaceState
so you can now change the query string of the top-level frame as shown below. It’ll throw an error if you try to change the pathname, since that could allow for malicious ‘spoofing’ of other generators as mentioned above.
history.replaceState({}, "", `/${generatorName}?foo=1`)
window.location.hash = "#foo"
(you can also do this with replaceState
IIUC).document.title = "foo";
and it’ll propagate to the top-level frame.<link rel="icon" href="https://exampe.com/image.png">
to <head>
) and it’ll propagate to the top-level frame.Let me know if you find any bugs 👍
And I’ve added a hideGalleryButtons
to the text to image plugin.
Allowing general-purpose cross-domain access like this is not possible, since it would allow very easy login credential stealing, and stuff like that, but these particular things that you’ve mentioned are good suggestions.
RE gallery button: You’re talking about the “send to gallery” and the “open gallery” buttons in the menu after clicking the heart button, right? Would something like this work?
promptData
prompt = ...
hideGalleryButtons = true
I have needed history.replaceState
before myself, but haven’t gotten around to properly thinking about it. I think it should be fine to allow a generator to change the query parameters and hash (i.e. everything other than the pathname - since otherwise could ‘spoof’ other generators/pages). Can you let me know your specific use case to help me triangulate on a good approach here? Do you specifically need pushState? Or will replaceState do? I’m reluctant to add pushState because it can be used ~maliciously - like the spammy sites that effectively hijack your back button to prevent you from leaving the page (or at least, make it require an extra click or two).
Oh, right, yes, when using evaluateText
on said string, that makes sense - due to square blocks having the policy of always “saving escape-char-processing until right at the end” as mentioned above. And yeah I agree this inconsistency is very annoying!
@VioneT@lemmy.world @Alllo@lemmy.world I can’t recall exactly who had this problem (wanting to use comments plugin on plugin page, but not wanting to cause it as an import for users of your plugin). I’m sure a lot of people have had this issue, but pinging the two of you because I think you might have mentioned it before.
Is this tl;dr correct? You want:
{import:...}.property
or {import:...}(args)
in the HTML panelCombined, they would allow for e.g. importing perchance.org/comments-plugin into perchance.org/my-cool-plugin without causing every generator that imports my-cool-plugin to also have to uselessly import the comments plugin code.
Is there anything I missed there? If not, I think the best approach to solve both #1 and #2 is to use the perchance.org/dynamic-import-plugin You still have to import that plugin, of course, but it’s very light-weight, so it’s fine if importers get that as an additional dependency. Example:
https://perchance.org/import-only-in-html-panel-no-dependency-example#edit
This is really only possible (in the general case) thanks to your prodding me on getting recursive imports working on perchance.org/dynamic-import-plugin - so thanks!
That said, I think #2 should be possible without too much trouble. #1 is a bit harder because it requires some new syntax, but still viable.
or sitting on my hands doing nothing […] And I always chat to you about it here anyway
I really love how you just dig in and solve the problems yourself - this is a very useful trait to have in life. So long as you let me know so I can create an “official” way I’m happy 😅 Thanks for pushing at the edges of the engine - it’s very helpful! I’m going to switch https://perchance.org/dynamic-import-plugin to use the new recursive import code now.
To help me understand, can you give an example of what you’re trying to achieve? Note there’s perchance.org/super-fetch-plugin which can bypass CORS if you’re just trying to fetch a cross-origin resource that doesn’t have the appropriate CORS headers.
If you can give feedback on https://perchance.org/dynamic-import-plugin-test1 that would be great. You should be able swap out your {import:dynamic-import-plugin}
for {import:dynamic-import-plugin-test1}
and if it doesn’t do something that you want it to, or if it breaks something, or whatever, let me know.
Btw, I don’t think this is correct: imported = dynamic_import(name); window.moduleSpace[name] = imported;
since the dynamic import plugin returns $output of the module if it has one.
And in general, making your own edits to moduleSpace
is probably not a good idea. If there’s something like this that you want to do (i.e. “messing with internals” to some degree), then you should always make a feature request. Otherwise all your stuff could break at some point due to engine implementation-detail changes. But if something is documented in perchance.org/examples or perchance.org/advanced-tutorial then it’s safe to use.
If there was simply a difference between a string made with perchance (or explicitly perchance-ified), which has all the extras attached, and a string you just make in JavaScript, then none of this would be an issue.
Wait, this sounds like a separate bug report. The issue I’m talking about is (I thought) only relevant to Perchance nodes, not raw strings. Can you give an example where Perchance interferes with your <script> tag where the text you’re manipulating doesn’t come from a Perchance node/property?
What was causing that?
The iframe signals the the parent/editor frame when it’s finished loading, but the error in the dependency caused the iframe to never send that signal, because I didn’t try/catch it properly.
Ah thanks, found and deleted it - old code that had no effect anymore (it had no impact on the issue you’ve reported here, to be clear - it’s unfortunate how hard it is to track down async stuff like this via pausing the debugger, which I’m guessing is how you hit upon this false positive).
Thanks! Sorry about that - this bug is fixed now.
Aside: Where is window[sadf5456]
? Do you have an old version of the Perchance editor/interface due to a local response override in DevTools? Perchance doesn’t use riot
at all anymore.
I wasn’t sure if it was a good idea to continue posting in that thread or make new one, so I’m making a new one.
Yep, please create new ones, and feel free to keep re-posting important things once every few weeks to move things up my todo list. Thanks for nudging me on these!
Introduce copy button in prompt and anti prompt fields for better UX on mobile
Do you mean in the gallery? Or in the “info” box that shows over the top of a generated image? Or in the place where you type your prompt (e.g. on perchance.org/ai-text-to-image-generator)
I’ve just added the thumbs up/down on mobile by default, and added some buttons at the top of the feed for visited galleries. What is your use case for search? E.g. mainly for searching though (up to a few thousand images) in your own private gallery, say, or mainly for searching public gallery - i.e. possibly tens of thousands or more.
Checking the HTTP headers for dynamic imports API, I see they are:
public, max-age=0, s-maxage=10
And that seems to match what I see in testing just now. I.e. it’s only cached for 10 seconds at the maximum. Is that still too long?
I thought I’d tried onload
Yep you’re not imagining it - by “Thanks! Fixed” I meant that I fixed both defer
and the window load
event. DOMContentLoaded
was the only thing that was working properly before this bug report.
As a general strategy for parsing stuff out of free-form/natural language, I’d definitely recommend using the AI text generation rather than regex, since natural language is so diverse that regex will fail a lot of the time. In most cases there are too many different ways that things can be said to be able to capture them all with regex.
I assume you’re talking about perchance.org/ai-character-chat custom code, and if so, you could do something like this:
More info on custom code for perchance.org/ai-character-chat is here: https://rentry.org/82hwif