Comments (16)
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.
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.
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.
Sure, I can give it a shot. Might take me a bit to figure it out.
from scribe.
@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.
@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.
New link: https://github.com/guardian/scribe/blob/master/CONTRIBUTING.md#testing-via-sauce-labs
from scribe.
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.
@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.
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.
@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.
Any updates on this? Is it a big issue for you?
from scribe.
What’s the status of Firefox 29?
from scribe.
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.
FWIW OS X Firefox has the same issue. Rich text cannot be pasted.
from scribe.
@TooTallNate I’m not seeing that?! That would be a pretty big bug…
from scribe.
Related Issues (20)
- allowBlockElements=false in Safari prevents entering new lines HOT 2
- Pressing Enter while having a selection in inline-mode does not delete the range content HOT 1
- Roadmap to making Safari support official?
- lodash dependecy still exists. HOT 10
- Pasting inserts paragraph tags even in inline-mode
- Remove Unexpected Usage of ES6 const HOT 2
- NPM releases improvements HOT 3
- Pull requests welcome? HOT 1
- Scribe commands not working when triggered in child iframe HOT 1
- whether consider supporting umd? HOT 2
- command plugin problem
- Edge compatibility HOT 1
- cjs version [email protected] does not work with browserify w/ deamdify
- UndoManager and a max length plugin
- Any chance of supporting lists?
- Un able to import Scribe using angular Cli
- plugin injection into existing `scribe` instance HOT 1
- Demo is broken
- Selection.range collapses when selecting the last word of a paragraph HOT 5
- Text alignment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scribe.