dnsev / 4cs

Media player userscript, steganographic embedding
https://dnsev.github.io/4cs
15 stars 3 forks source link

Sounds Uploader "Where is my submit button?" and more くそ。 #12

Closed vampiricwulf closed 11 years ago

vampiricwulf commented 11 years ago

You have #qr > form:nth-child(2) > div:nth-child(4) (also known as the submit bar) go display: none !important; when opening the sounds section, but on closing the sounds section and revealing the submit button, the file and the sounds set up in the section below information is lost on dechecking the sounds button. Even with custom CSS, your js overrides anything I do to save it.

vampiricwulf commented 11 years ago

Deleting this fixes the issue, but I bet it wastes/breaks a bit of your code. :wolf:

vampiricwulf commented 11 years ago

Looks like the follow up is "Why can't I submit my post?"

vampiricwulf commented 11 years ago

Also, your auto-blocker still does when the uploader is disabled. I don't see the purpose in that.

dnsev commented 11 years ago

1) Yes, I assumed this was going to happen, with all the compatibility issues this must spawn.

The CSS is a pain to work with, particularly because all of the other extensions that use !important on EVERYTHING.

I think I'll try and fix this by not making the submit bar hide itself, but instead, just the file selection box.

2) The above should address this, if it works.

3) What seems to be the issue here? Does clicking the submit button do nothing? Does it show any error box? Does the button status turn to "..." (if so, does it ever return from this status?)

Also what browser and what plugins are you using.

4) I have found the problem and fixed it. Will be in the next (soon) update.


Funny how the goal of this was to make it a bit more compatible with other scripts than the other uploader (also, it already has the decoding source built in,) but it seems to be doing the opposite.

dnsev commented 11 years ago

Also, might I suggest using the full version of the script if you plan on parsing through the file (as it seems like you've done.) This version is a bit more readable/spaced/commented:

https://raw.github.com/dnsev/4cs/master/web/4cs.full.user.js

Visible at the link: http://dnsev.github.com/4cs/#?dev

vampiricwulf commented 11 years ago

Mother of god.

  1. There's now two submit buttons using my css.
  2. When using the new submit I get:
Submit form key "recaptcha_challenge_field" could not be found.
Submit form key "recaptcha_response_field" could not be found.

Also, "No File Selected" becomes the same text as the one in red when no CSS. 3.When using the normal submit:

  1. Disabling my CSS and pressing the button:

Also, I'll use the full from now on, sorry, I'm just use to js like noface-x and oneechan. Note: I have a 4chan pass, that's probably what's causing the captcha issue. (How did you do the line break?)

dnsev commented 11 years ago

1) I tried to fix that in 3.0.2; probably another issue with CSS priority. May or may not have fixed it; but additionally I tried to disable the submit button you shouldn't use, so even if it's still there, it shouldn't be usable.

Yeah, it looks like I can't get the submit button to completely go away using your stylish CSS, but it is now no longer visible or usable.

2) I also tried to fix that too. It seems that the 4chan pass is stored in the pwd field? Or that's as much as I can gather from other userscripts. If this is the case, captcha shouldn't be required anymore.

3+4) Now the secondary submit button should be the only one visible, and should be the one that tries to upload the files (presuming I got everything correct.)

I tried it just now and it seemed to work, but again, what works for me rarely works for everyone else.

5) Line break? Like in the github reply field? --- on a line by itself

vampiricwulf commented 11 years ago

The second submit button issue is fixed, though there's now an empty bar (for my css). shrug

    div>input.MPSoundUploaderOriginalSubmitButtonHidden {
        display: none !important;
    }

Fixes the empty bar issue.


Submit form key "recaptcha_challenge_field" could not be found.
Submit form key "recaptcha_response_field" could not be found.

List of cookies names, idk which one is the one: The one that expires in the reasonable time (which moot says lasts 30 days) is 4chan_pass

vampiricwulf commented 11 years ago

Looking at how mayhem did it: https://github.com/MayhemYDG/4chan-x/commit/790403df044c2e59ff9121914e79d369c841a8f9

dnsev commented 11 years ago

The empty bar looks pretty difficult to fix without going full display: none on the file bar, which I don't want to because it keeps the submit button in the same place on other scripts. Not really a huge issue though, I knew going into this that it might not look exactly the way I want it on every single script out there. Plus, I can't detect that it's a stylish script and hard-code a solution for it like I have for several other userscripts.

Basically, so long as it's not page breaking and the features are all still there, I'm okay with minor flaws like this. (Making userscripts try to run on top of other userscripts running on a website is awful.)


The 4chan pass may have been fixed (again), so see how that goes. Thanks for the link on how 4x did that.

vampiricwulf commented 11 years ago

I can fix the empty bar on my own thanks to you giving it a class. So don't worry about coding that. Or, instead of having the submit button there, why not place it centered on the same line [Help] is and remove the file bar? (Just an idea.)


Still getting the same errors as before. Maybe let's look at 4chan Sound Uploader's coding: Lines 2352-2353

            var passMatch = document.cookie.match(/4chan_pass=([^;]+)/);
            if (passMatch != null) pwd = decodeURIComponent(passMatch[1]);

Looking in-depth at 4x v3:

        if (d.cookie.indexOf('pass_enabled=1') >= 0) {
          return;
        }
...
        pwd: (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $.id('postPassword').value,
dnsev commented 11 years ago

1) Look at where the inline extension places the submit button (hint: it's nowhere near the bottom of the form.) If I did that, there would be 2, so I just tried to maintain the same position of the submit button.

Also, the [Help] thing can be disabled in the settings, so that line can be hidden altogether if unnecessary.

2) Man, that's the exact same thing I had before. I'll see if I can get a quick debug version that provides some more info.

vampiricwulf commented 11 years ago

Alright man, make sure to say something in here when you've updated. I'd love to help immediately, but I'm going to be in class until 10 PM PST, so I most likely won't be able to do any testing until tomorrow noon PST. I may pop on for a brief 10 minutes at around 8-9PM and tomorrow at around 9-10 AM so I can do minor quick tests at those times.

dnsev commented 11 years ago

Not an issue; I doubt this will be used profusely any time soon. But it's good that someone's willing to help fix the problems, whereas most people just complain about it and do nothing. So thanks.


Debug version: https://raw.github.com/dnsev/4cs/master/web/4cs.debug.user.js

If the issue still isn't fixed, see what appears in the textbox (that should appear in the top-left) when you try and post.

Also be sure to switch back to the normal version when you're done testing.

vampiricwulf commented 11 years ago

No problem man, I enjoy helping developers, it makes me feel like I have I'm actually contributing to the greatness of the actual program. Any program I use daily I have the tendency to get really involved. Tell me to shut up or w.e. you see fit. I tend to annoy most developers from my pov.


pass_enabled=true
4chan_pass=true
pass_id=false

Now it's ... let's wait and see... Is this doing anything?

Detected JavaScript + cookies + blocked referer. Your post looks like spam this way, so either enable referers or disable JavaScript and cookies. [

What the actual fuck? Tried it twice, same result, now I'm going to try a pre-perpared version of the same thing. Works fine with the pre-prepared version.

dnsev commented 11 years ago

Define "pre-prepared."

Also, try inserting force_xhr: true, on the following line: (inserting, not replacing) https://github.com/dnsev/4cs/blob/master/web/4cs.debug.user.js#L11318
I just tried a few more posts, including using force_xhr, and they worked for me. That's a strange error.

vampiricwulf commented 11 years ago

Pre-prepared: Having the same image with the same sound file pre-embed in. Still just '...' It doesn't start doing any %. Suddenly the image is posted. Maybe a % complete would be nice? Other than that, it works by adding that line.

dnsev commented 11 years ago

Okay, that's good to know. Not sure why that change makes it work for you, assuming you're using Firefox. Although, I am using Nightly, so that might be it.

There is supposed to be a % change, and it's actually programmed in, but the onprogress event isn't working or something. I'll debug that more too.

Actually, I just found out why it doesn't work. So I'll get on that too.

vampiricwulf commented 11 years ago

I am using Nightly as well, maybe I was just bugging out. I'm using college-net right now so that could have been what also added to the issue. (But that usually comes up as Connection Issue error)


Alright, I'll keep my eyes open for a commit. Keep up the good work. Close this if you find everything to be finished. I'll keep my eye on this issue even if it's closed until at least all the kinks with upload are gone.

dnsev commented 11 years ago

I doubt the network was the issue; firefox likes to work slightly differently on different computers, and it's always little tiny things like this.

It seems to be a difference in the way XMLHttpRequest and GM_xmlhttpRequest work; I have to use XMLHttpRequest here in this case, but for image fetching, I need GM_xmlhttpRequest. In Chrome however, only XMLHttpRequest needs to be used.

It's odd; they pass the referrer or something differently.


But everything should be fixed now; uploading % displays, and should use the type of upload you said worked, along with other stuff unrelated to this discussion.

vampiricwulf commented 11 years ago

Good to know, thank you for the information.


Yep, the percentages help, thank you. Now i know something is actually happening rather than ... If there's ever anything you need tested, just give me a heads up.