Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rangy.getSelection undefined #109

Closed
timdown opened this issue Mar 22, 2014 · 9 comments
Closed

rangy.getSelection undefined #109

timdown opened this issue Mar 22, 2014 · 9 comments

Comments

@timdown
Copy link
Owner

timdown commented Mar 22, 2014

From paleozogt on June 08, 2012 19:43:25

What steps will reproduce the problem? 1. Copy rangy-core.js to the clipboard
2. On IE9, go to this page https://www.npr.org/2012/04/28/151584377/the-woes-washington-baseball-fans 3. Open the IE developer's console (F12)
4. Paste in the contents of rangy-core.js and execute it
5. In the console execute: rangy.init()
6. In the console execute: typeof rangy.getSelection What is the expected output? What do you see instead? On FireFox, step 6 will show 'function'. On IE9, it will show 'undefined'. What version of the product are you using? On what operating system? Rangy v1.2.2. IE9 on Windows 7. Please provide any additional information below. This is sort of a contrived example, but it easily shows the problem I'm having.

Original issue: http://code.google.com/p/rangy/issues/detail?id=109

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From paleozogt on June 08, 2012 11:45:46

On IE9 (on the example webpage), rangy.init will log this to the console:
"LOG: Init listener threw an exception. Continuing.Error: Access is denied."
which apparently derails the rest of the initialization.

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From timd...@gmail.com on June 08, 2012 16:48:51

Does this problem happen when Rangy is included in a page via a script tag rather than via the IE9 console?

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From paleozogt on June 11, 2012 13:45:26

Yes. In my case, I'm injecting a script tag that pulls in rangy after the page has loaded. Pasting it into the console is pretty much the same thing (and easier for you to reproduce).

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From timd...@gmail.com on June 11, 2012 14:58:52

Easier to reproduce but less good for debugging (debugger doesn't work and you get no line number for the error), probably because the console uses eval. I isolated where the problem was occurring by injecting the script. More investigation required, but I have an idea of what to do.

Status: Accepted

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From paleozogt on June 12, 2012 07:54:54

Ah, true about the debugger. Thanks for looking into it!

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From timd...@gmail.com on June 20, 2012 17:36:31

Fixed in 1.3alpha.673.

Status: Fixed

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From philvar...@gmail.com on May 16, 2013 19:47:42

Also, in the latest version of IE9, this causes the browser to crash when printing a page that includes rangy. The fix in 1.3alpha.673 does not cause this problem.

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From timd...@gmail.com on July 25, 2013 15:34:54

So is the IE9 crash still present in the current alpha?

@timdown
Copy link
Owner Author

timdown commented Mar 22, 2014

From prag...@gmail.com on August 27, 2013 03:39:57

Hi, I am trying to inject rangy into a webpage from a firefox extension and I am getting an exception "Init listener threw an exception". So I tried executing the contents of rangy-core.js in Firefox console. After that executing rangy.init() on console gives this error:
Init listener threw an exception. Continuing. [Exception... "The operation is insecure." code: "18" nsresult: "0x80530012 (SecurityError)" location: "Web Console Line: 2520"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant