Current position:  Home > Default > Exception in javascript library when testing Mail app with IE9/ Safari

Exception in javascript library when testing Mail app with IE9/ Safari

Time:October 11
Advertisement
Hi,
I have almost finished my mail app, but a strange issue that only appears with IE9 prevents me from successfully completing the verification process and therefore I can not publish my app.
The issue is very similar to this post, which could unfortunately not have been answered so far:
'OSF is undefined' script error in o15apptofilemappingtable.js
file when Mail App launched
I have tested the app successfully with the following browsers: Chrome (40.0.2214.111 m), Firefox (35.0.1), IE 11 and IE 10.
In IE9 I first get:
App
Error Something
went wrong and we couldn't start this app. Please try again later or contact your system administrator.
When
I then click "retry" I get:
App
Error This
app may not load properly, but you can still try to start it.
After
I click start the app works. The debug console of IE indicates that there is a problem in the o15apptofilemappingtable.js file:
SCRIPT438: Object doesn't support property or method 'GetContext' o15apptofilemappingtable.js, line 11 character 110934
The problem should be the call to: "window.external.GetContext()" in the file mentioned above.
Important to mention is, that when I build and deploy the sample mail project that ships with Visual Studio it just works fine (this is a difference to the other thread from above). There must be something special with my code but even after days of research
I can absolutely not figure out what it is. In contrast to the sample mail app, my project is an ASP.NET MVC application by the way (if that is important).
To isolate the problem I tried several things:
* I have removed all other javascript libraries to make sure that there are no conflicts between them.
* I removed all javascript code except the Office.initialize= ...
code to be sure that there isn't a problem with my custom javascript code. 
But whatever I tried it doesn't help and basically I am fishing in troubled waters as I do not have an idea what the real problem is and why it is only happening on IE9.
Best regards
Stefan
Advertisement
Hi,
in the meantime I noticed that I also get this problem with Safari.
I started to debug the office api and could isolate the problem further. 
Please forward the following information to the responsible microsoft engineer as it contains valuable information to fix the problem.
The Exception I get happens becaus of a call to window.external.GetContext() in in the o15apptofilemappingtable.js.  The calls happens because in the function OSF.InitializationHelper.prototype.getAppContext, the value of this._hostInfo.isRichClient
is true. Looks like in IE9 and Safari the api thinks it is running in the desktop version of outlook (but of course it is not and therefore the call to window.external fails -> I guess only available/set in desktop environment).
The api thinks of running as rich client becaus the XdmInfoValue does not exist in o15apptofilemappingtable.debug.js line 155 (it is undefined). I am not a javascript specialist and don't know what xdm stands for (cross domain? X-Document?) but however:
the xdm part which should be passed in the window.location as a hash value is not set in IE9/ Safari.
At this position I lose the scent and don't know where the xdm part is passed/added to the url. Perhaps in the osfruntime.js? Unfortunately I couldn't find a debug version of this file.
Please do not hesitate to contact me if you have further questions
Regards
Stefan

Mail app keeps launching Safari

-0001-11-30

Google Chrome is set as the default browser (and yes, I've verified that this is the case in Safari's preferences). If I click a link from within a Mail message, Chrome is launched (as expected). But if I select text in a Mail message, right-click th

Mail.app reading HTML messages - status line?

-0001-11-30

Is there a status line or other field that displays the contents of an embedded link in HTML messages? If so, where is it, and how does one enable it? To be precise, what I am looking for is the equivalent to the status line that Safari displays at t

Configuring mail account in Mail App with restriction account on

-0001-11-30

Hi there, How is possible to create an account in Mail App with the restriction Accounts enable? I explain myself. I configure all the iPads of my business with the restrictions enabled and select "Don´t Allow Changes" on the Accounts tab. Setti

MAIL-more .emlx files in Library than messages in Mail.app

-0001-11-30

I have seen that the number of messages .emlx in several Folders and subfolders of my Library/Mail/V2/..... is much more than the actual number of Mails to be seen in the different Folders of Mail.app.   I keep only a limited number of Mails (last fe

Spotlight, Mail app and Entourage

-0001-11-30

I was using spotlight today to try and find info ("this.x" inside a Javascript inside a .qtz file). Interestingly Entourage (which i rarely use) generated a hit for an email message where Mail app did not. Searching inside Mail app itself found

Setting rooms/resources for appointment through mail app

-0001-11-30

Hi, Is there any way to set the rooms for an appointment through mail app, i know i can set the location field of appointment in compose mode.  I was wondering if there is any way to add/modify/remove rooms form appointment when outlook appointment i

Mail.app keeps saving downloads to Mail Downloads rather than ~/Downloads

2015-10-11

I've modified Mail.app preferences to save downloads in the main downloads folder, ~/Downloads. But every time I double click an attachment, it still downloads to the wrong folder, Mail Downloads, in a terribly nested directory, ~/Library/Containers/

Mail app wont open/ crashes

2015-10-11

I turn on my mac this morning and the Mail App wont open, it keeps on crashing. I tried holding shift key while opening it and the program does open, but when i select a message it crashes again. never had this problem before. There is not current up

Multiple instances of Mail.app must be possible

2015-10-11

I've seen many questions regarding the possibility of running multiple instances of Mail.app as separate processes. There seems to be much good reason to be able to do so, i.e. separating work and private mail, and very little bad reason to do so (ma

Attachments not received in Mail app

2015-10-11

I received a couple of email where the attachment is not received in the Mail app.  It doesn't show up anywhere. The attachment is received on my iPad, iPhone, and iPod with no problems.  Also, I have another message where the html images are not dis

Mac Mail.app download problems

2015-10-11

Hello, I think I have tried everything.  I am currently trying to do the simplest tax ever.  I want my mail downloads to go to my downloads folder that I see in my downloads folders, the same folder safari does fine downloading too.  However when I c

Mail.app too many Ins and no outs

2015-10-11

My Mail.app has never been innocent of odd lapses here and there. As a user with modest demands, I've ignored the less egregious problems. In recent days, my more egregious problems have escalated. My email client downloads messages from the POP serv

Mail.app prefs. fail to change location of Downloads folder.

2015-10-11

I recently migrated my mail from Eudora to Mail.app (Mac Pro, OS 10.6.8). I usedthe Mail.app Preferences to change the location of the Downloads (i.e. attachments) folder from the default location (Users>Library>Mail Downloads) to the subfolder in t

Sporadic Mail.app crashes when previewing messages with attachments

2015-10-11

Hi, Mail.app crashes about 10% of the time that I click on an e-mail with an attachment. It seems to crash as it is decoding the attachment for viewing in the preview pane of the application. It doesn't seem to matter what type the attachment is. I t

How do you stop Mail App from recovering deleted emails

2015-10-11

I use Mail app to manage multiple email boxes. Whenever I send a message, it will fail and ask me to send through another server. If it fails, it will infinitely ask this question. Also when I cancel it, it will infinitely recover and try to send the

Mail app on OSX crashes when I do something on iPhone mail app

2015-10-11

So whenever I have Mail.app open on my mac(which I would do all the time), and I see a new mail on my iphone (same mail.app) and I try to archive, reply, delete or whatever to do, the app on My Mac crashes. Straight after I do ANYTHING on my iphone .

Mail.app Stopped Working with Google Apps Account

2015-10-11

I have accessed my Google Apps e-mail account via Mail.app for many months with no problems. Then all of a sudden yesterday it has stopped working. I can't download new messages no matter what I do, and it does not give me any errors such as wrong us

Mail App stopped working, any suggestions, Mail App stopped working, any suggestions

2015-10-11

HELP Ok first my Mail APP after 4 years stopped syncing with GMAIL and two days later ICLOUD.  I deleted all accounts and readd them and nothing happens.  How do I uninstall the mail app and reinstall it.  Or does anyone know of a better Mail App to

Mail.app stopped working over IMAP to exchange 2003 server

2015-10-11

Hi Peoples, I'm posting this as a problem with the solution simply because of the absolute bizarre behavior that I observed.... PROBLEM On Thursday night, without me having made any changes to either my mac or my exchange server, mail.app just stoppe