GithubHelp home page GithubHelp logo

Comments (16)

OliverJAsh avatar OliverJAsh commented on June 10, 2024

Nice find!

Have you got a link so I can take a look at your fork? Or, raise a PR and we can discuss it there? Obviously I would normally be against using the user-agent to determine support, but this sounds like a very special browser inconsistency, so maybe that’s the right thing to do in this case.

from scribe.

thedanbob avatar thedanbob commented on June 10, 2024

Here: thedanbob@4e6ea74

Might be able to make it more specific than all Firefox and all Windows versions, but like I mentioned I can't test any other combinations.

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

Thanks for sharing that.

I would like to see a failing test for this before we merge the fix. Do you think you could have a go? We run the tests on Sauce Labs so we should be able to test it against various platforms and browser versions.

There are some steps for running the tests in the contributing docs.

from scribe.

thedanbob avatar thedanbob commented on June 10, 2024

Sure, I can give it a shot. Might take me a bit to figure it out.

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

@danbob Let me know if you get stuck at any point, I will try to respond on here and via IRC (Freenode) under OliverJAsh ASAP. It shouldn’t be too difficult 😄

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

@danbob Just added some docs that will help https://github.com/guardian/scribe/blob/oja-sauce-connect/CONTRIBUTING.md#testing-via-sauce-labs

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

New link: https://github.com/guardian/scribe/blob/master/CONTRIBUTING.md#testing-via-sauce-labs

from scribe.

thedanbob avatar thedanbob commented on June 10, 2024

Well, this is trickier than I thought it would be. It seems that HTML copied from within Firefox is identified correctly as text/html. It's only when you copy from an external source (e.g. Chrome, Microsoft Word) that it fails. I have no idea how to test that 😕

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

@danbob In that case, is this still a Firefox bug? I thought the MIME type was set by the application you copied from? I don’t really know how any of this works, but it would be good to know more.

Firefox 28 on OS X 10.9.2 correctly identifies pasted HTML as text/html, while Firefox 28 on Windows 7 x86 does not.

Have you tried pasting with Chrome on Windows 7 (x86)?

from scribe.

thedanbob avatar thedanbob commented on June 10, 2024

I thought the MIME type was set by the application you copied from?

@OliverJAsh I thought so too, but I guess not... or maybe Firefox is just ignoring it. If I copy HTML from Firefox or Word and paste into Chrome, it behaves as expected. If I copy from anything besides Firefox and paste into Firefox, I hit the bug. (All on Windows 7 x86, of course.)

from scribe.

thedanbob avatar thedanbob commented on June 10, 2024

@OliverJAsh here's some technical details I found while debugging: on paste, the event contains a ClipboardEvent object which has a types method. In Chrome, types is just an array i.e. ["text/html","text/plain"]. In Firefox, it's a DOMStringList that acts like an array (you can do types[0]).

Also, it looks like the bug extends beyond Windows. When copying RTF text from TextEdit on OS X, Chrome identifies it as ["text/plain","text/html","text/rtf"] but Firefox only gives ["text/plain"]. When copying the same content from Word on OS X, Chrome gives the same MIME types and Firefox reports ["text/html","text/plain"].

My best guess is that either Firefox doesn't correctly interpret the MIME types set by some applications, or they aren't set by the applications properly and Chrome just does a better job of figuring them out.

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

Any updates on this? Is it a big issue for you?

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

What’s the status of Firefox 29?

from scribe.

thedanbob avatar thedanbob commented on June 10, 2024

Firefox 29 is the same. It's not a big issue, the user agent check does the trick for me and I can easily apply it manually for new scribe releases. Also, it looks like the bug is finally getting some attention from the Firefox devs, so hopefully it won't be a problem for much longer.

from scribe.

TooTallNate avatar TooTallNate commented on June 10, 2024

FWIW OS X Firefox has the same issue. Rich text cannot be pasted.

from scribe.

OliverJAsh avatar OliverJAsh commented on June 10, 2024

@TooTallNate I’m not seeing that?! That would be a pretty big bug…

from scribe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.