Servicestack-SwaggerUI crashes on IE<10 for method "defineproperty" not found - javascript

I'm using SwaggerUI over a Servicestack v4.07(licensed) application to expose REST specs.
Everything works on Firefox and Chrome, but when i try to open the swagger index with IE9 or below, it crashes, showing nothing but the page header, so no service is listed.
Actually i can reproduce this but even on the swagger demo website http://petstore.swagger.wordnik.com/
When i open it with IE9 it crashes because of a (probably) known issue: https://github.com/wordnik/swagger-ui/pull/204.
When i open it with IE8 instead the fiddler tells me that there's no such defineProperties method for the Object class(exception raised from shred.bundle.js)
Does someone know about such issues?

Related

PostHog | Brave Browser Event Tracking Issue

we have implemented Posthog with React and tested the implementation, which is working fine on Chrome and Firefox. But when we are testing it on Brave/Microsoft Edge Browsers it is not working.
We have done some research on this, which says these browsers have default ad blocker feature enabled and I need to manually disable ad blocking.
For resolving Brave browser tracking issue, we have created self hosted cloud front distribution and pass cloud front url in api_host parameter inside posthog.init function but it's not working and I am getting authentication issue. Could you please guide me for the same ?
I have used posthog-js in my react app for tracking events. Everything is working properly on chrome browser but my custom events are not getting triggered on brave browser.
Here is console logs error, please have a look to attached screenshot
The errors in the screenshot are the Brave browser doing its thing and blocking third-party scripts. You can check this using "shields" https://support.brave.com/hc/en-us/articles/360022806212-How-do-I-use-Shields-while-browsing-
I'd recommend you set up a reverse proxy so that traffic to PostHog travels to your own domain. So you would have something like https://my-own-domain.com/e
see https://posthog.com/docs/integrate/proxy
(as in the comment thread above. full disclosure I'm an engineer at PostHog)

Office.js displayDialogAsync not working correctly in word online on IE

I am working on a word web add-in that is mostly finished and working fine in office 2016/2013 and word online on chrome, edge and firefox. However I am experiencing an issue with running it in word online on IE 11.
Users log into the app with an azure active directory account, which is done via a popup using the Office.context.ui.displayDialogAsync method.
As I said this works fine everywhere except word online on IE.
The issue as far as I can tell is that on IE, in the popup it isn't seen as a valid office environment, and so office.js isn't initialised properly. Office.initialize never seems to be called and if initialise my app manually instead then an error ocurs when the popup tries to communicate back to the main window via Office.context.ui.messageParent with the message: Unable to get property messageParent of undefined or null reference.
Also supporting this is that when I check the host type with OfficeHelpers.Utilities.host, in the popup on chrome or edge it shows "WORD" and on IE it shows "WEB", this seems to mean that Office.initialize is never called and Office.context.ui is left null?
Can anyone advise if I am missing something or is this some kind of bug in office.js?
I have tried using office js from https://appsforoffice.microsoft.com/lib/1/hosted/office.js and also from the latest npm package and it is the same for both.
Edit: Having done some investigation into how displayDialogAsync works I can see that when it creates the new window it captures the current context such as Word|Web|16.00|EN-US|<some guid>. This seems to work everywhere but in IE, it does however work when simply opening a dialog of a regular page in IE, but when we sign into AD it must go to the AD sign in page then redirect back, which is where this value seems to be lost (in IE).
It seems the particular issue I was seeing (with the state not being preserved in IE after navigation) was due to the fact my web app was running locally and IE treats localhost as a different security zone to regular sites (such as the AD sign in page), which was causing the state to be lost when it transitioned between them.
I got it working by unchecking these boxes under intranet (so that localhost falls under regular Internet rules instead)

Chrome SecurityError loading jQuery Mobile page from local file system

I get the following error in Chrome when loading a trivially simple html file with a jQuery Mobile reference. The error is not present with just the jQuery reference.
Uncaught SecurityError: Failed to execute 'replaceState' on 'History':
A history state object with URL 'http://stacksnippets.net/js' cannot
be created in a document with origin 'null'.
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"></script>
</head>
<body></body>
</html>
You can also "Run code snippet" and see the error in the console.
This error did not happen before today. I have not changed my code or method of loading the html file in the browser. It used to work perfectly - I use the same code for all my PhoneGap apps.
Does anyone know if there was a Chrome security update that causes this SecurityError or whether I'm missing something? How would you go about debugging this? Thank you.
UPDATE
This discussion I think points out what is going on, which I suspected, since the error does not appear when running with a web server: Origin null is not allowed by Access-Control-Allow-Origin .
But I am still wondering why this changed in the past day, whether Chrome has had a change in their security policy, or why it was working before, and whether any of my PhoneGap apps will be affected.
This error is same as the origin is null error. This error occurs because of the security feature of Chrome.
A simple solution to test the application is to bypass this security on chrome.
Steps:
create a chrome browser shortcut on desktop.
Close all the instances of chrome on your machine.
Right click on the desktop shortcut of chrome and click on Properties.
in Target field, append " -allow-file-access-from-files" at the end.
Save and close properties.
Open chrome via this shortcut only.
Hurry, the error has gone. App works perfectly.
NOTE: This is just a work-around I use to test my cordova apps on desktop browser for UI testing.
Temporary solution: I've commented out all history.replaceState calls in jquery mobile, didn't need to manipulate browser history in my app anyways.
I wonder if it's chrome security bug or model and future behavior.
On a Mac I was able to fix this by running a webserver instead of loading it from a "file://" url:
http://lifehacker.com/start-a-simple-web-server-from-any-directory-on-your-ma-496425450?utm_expid=66866090-49.VYy4WCNHSyuP6EmjnM93MQ.0&utm_referrer=https%3A%2F%2Fwww.google.com%2F
python -m SimpleHTTPServer 8000
In the directory should make it available from Chrome via 0.0.0.0
I don't seem to have the same problem, not on the stable version of Chrome (45) or the Dev version (47).
However, I have personally seen issues with the CORS header, too. If you can cause the problem to happen reliably, I suggest filing a bug at crbug.com and a Chrome developer will have a look at it.

Permission denied to call method ModalContentWindow.postMessage in Firefox

I am working with the YouTube Data API v3. Google recommends loading the libs using:
<script src="https://apis.google.com/js/client.js?onload=googleApiClientReady">
It works fine but when I load the script like this into a modal window in Firefox (it's got to be this way. I can't control the way my widget is called by Sitecore) it fails with:
Error: Permission denied for https://accounts.google.com to call method ModalContentWindow.postMessage
It comes from within internal callbacks that Google's client.js calls when loaded even if I omit the ?onload part.
Works fine loaded into a standalone tab. IE and Chrome do fine either way.
Is there a good way to make it work in FF modal window? (I am running 27.0.1 if it matters)
UPDATE: I worked around it by calling YouTube Data API HTTP endpoints directly. I am still wondering though what's up with that postMessage() thingy in FF's modal window and whether it's known to the authors of Google's client.js.
The main problem is that Firefox has policy for capability.policy.default.Window.postMessage.get but it doesn't have policy capability.policy.default.ModalContentWindow.postMessage.get.
There is two way to solve this issue.
add pref for Firefox pref("capability.policy.default.ModalContentWindow.postMessage.get", "allAccess");
instead of loading the script into a modal window directly put it inside iframe. iframe would have class Window.
BTW I faced this issue in FF28. In FF31 everything works fine.

File upload sometimes not working on IE9

I am using valums ajax-upload together with a ashx handler to let users upload files in the webapp Im developing. All is working absolutely fine for about 95% (around 3000) of the users.
For the last about 5% I get reports that the upload never finish, the wheel just keeps spinning people say. It seems that those who get this error are all are using IE9.0.
I have tested on all the IE9.0 I can come across but still have not been able to reproduce the error. I also have tried to log all thinkable errors but still no luck.
Please, can anyone reproduce the problem and hopefully give me a JavaScript console error transcript if any. To test go to step 2 (Upload section) and try to upload a small text file:
https://jobmatchprofile.com/backend/login.aspx?auto_login=24G3FY
UPDATE
I have been in contact with a user who experienced this problem. The error message can be seen here. It is in danish and says: "SCRIPT5 Access denied".
Error message
What is strange is that the user had same IE version as is working for others (me for example): I have been testing on: 9.0.8112.16421 and also ran WIN7 (as I). The Product-id differs however and he had a danish version where I have the US version.
UPDATE II
I was finally able to reproduce this error. I know this sounds a little strange, but belive me it is true: when opening the page via a link sent to my gmail account I get the same error. The user from first Update also used gmail to open the page.
Your reference to Gmail, specifically, points in the direction of a solution: Gmail strips the referrer data from the HTTP headers when you click on a link within an e-mail, except when you use your right mouse button and select "Open in New Tab [or Window]", presumably because this prevents their code from intercepting the headers. Is your script checking for a valid HTTP REFERRER, by any chance?
Are you making any cross-(sub)domain or cross-protocol AJAX calls? If so, then you may have to proxy the request(s). Consider the following solutions from the Yahoo! Developer Network:
http://developer.yahoo.com/javascript/howto-proxy.html
See also:
SCRIPT5: Access is denied in IE9 on xmlhttprequest
Access denied to jQuery script on IE
"Access is denied" JavaScript error when trying to access the document object of a programmatically-created <iframe> (IE-only)
(Un)fortunately, I wasn't able to reproduce the error in IE9, v. 9.0.8112.16421 (although I did get a general on-site error when trying to upload an empty .txt file, but this seems wholly unrelated).
The solution for ie9 is simply to upload using https:
https://www.parse.com/questions/internet-explorer-and-the-javascript-sdk
Even though you are sure that it's related to the user clicking the anchor within the email I would say it's because of policy settings within Internet Explorer. I have seen errors like these before and noticed that the most common errors were related to Internet Explorer policies of users within a corporate environment.

Categories

Resources