#13858 closed Bug (invalid)
Unhandled exception line 1935 ckeditor/core/selection.js when paste button pressed when run as an office addin.
Reported by: | gemmell | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Pasting | Version: | |
Keywords: | Cc: |
Description
Steps to reproduce
Please note this exception occurs when I run ckeditor inside an "Apps for office" extension.
- Using Visual Studio open the project I have attached and run it.
- Click in the ckeditor that appears to the right.
- Type something.
- Select it and press copy it (ctrl+c).
- Press any of the paste buttons.
Expected result
I would expect it to paste.
Actual result
I get an unhandled exception.
Other details (browser, OS, CKEditor version, installed plugins)
This is running inside whatever browser "Apps for Office" or "Office Addin" uses.
Attachments (1)
Change History (12)
Changed 9 years ago by
Attachment: | CkEditorTest.zip added |
---|
comment:1 Changed 9 years ago by
Note: You will need MS Office, I am running on windows 10, with MS Office 2013.
comment:2 Changed 9 years ago by
I believe it's using an embedded IE instance as when I crash out (different cause this time by the look of it) I get this:
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'createRange' Unhandled exception at line 1935, column 6 in https://localhost:44300/ckeditor/core/selection.js 0x80004005 - JavaScript runtime error: Unspecified error. The program '[5140] iexplore.exe' has exited with code 259 (0x103). The program '[15948] iisexpress.exe' has exited with code 0 (0x0). The program '[17596] WINWORD.EXE' has exited with code -1 (0xffffffff).
The version of iexplore installed on my machine is 11.0.10240.16431IS
comment:3 Changed 9 years ago by
However if I use http://ckeditor.com/demo using IE11 it is fine. Interesting.
comment:4 Changed 9 years ago by
Perhaps there is some clobbering going on between https://appsforoffice.microsoft.com/lib/1/hosted/office.js and cdn.ckeditor.com/4.5.4/standard/ckeditor.js
All my errors seem to be todo with selection or ranges...
comment:5 Changed 9 years ago by
Right clicking on any of those buttons actually works fine... now I am really confused...
comment:6 Changed 9 years ago by
My work around
// Work around for the paste crashes editor_.on('paste', function (ev) { console.log(ev); deleteCkEditorSelection(); editor_.insertHtml(ev.data.dataValue); ev.stop(); });
Does not work - the insertHtml() causes the same exception in the same spot.
comment:7 Changed 9 years ago by
Hrrm, from: https://msdn.microsoft.com/library/ms535869(v=vs.85).aspx
[selection is no longer supported. Starting with Internet Explorer 11, use getSelection. For info, see Compatibility changes.]
So I have a new theory that ckeditor is relying on some flag to detect the IE which is not being set when in the Office add in.
Yes, it's actually crashing in the else of a (isMSSelection) so perhaps if I keep digging i'll see where it's being set.
Hrrm. CKEDITOR.env.ie is true. CKEDITOR.env.cssClass is "cke_browser_ie cke_browser_ie11"
comment:8 Changed 9 years ago by
- sel {...} [Object, Selection] + [Methods] {...} anchorNode null Null anchorOffset 0 Number focusNode null Null focusOffset 0 Number isCollapsed true Boolean rangeCount 0 Number
So selection looks fine when we call sel.addRange( nativeRange );
As does nativeRange Argh.
comment:9 Changed 9 years ago by
I have done a bit more digging. There doesn't seem to be a conflict with other js libs, if I point the plugin directly to the ckeditor demo page I see the same behaviour. So I will have to dig further.
Perhaps some flag is not being set when it should.
comment:10 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Version: | 4.5.4 |
This is running inside whatever browser "Apps for Office" or "Office Addin" uses.
@ gemmell I'm sorry but we don't support "Apps for Office" or browser specific to "Apps for Office".
comment:11 Changed 9 years ago by
Hi, it's actually using ie10 but it's obviously using it in some way or with some setting or perhaps even some injected js that means that it doesn't play nice with CKEditor. But I respect the decision to not address it, and I have switched to a different editor anyway.
A default "Apps for office" plugin which loads CKEditor from cdn.