DisplayReplyAllForm is showing popup blocker alert in IE and Edge - outlook-addin

I am trying to open reply email using DisplayReplyAllForm, it is showing popup blocker alert in IE and Edge.
Office.context.mailbox.item.displayReplyAllForm(
{
'htmlBody' : emailBodyHtml,
'callback' : function(asyncResult)
{
console.log('reply mail with asyncResult.value ==> ' + asyncResult);
}
});
I am trying to execute this code in a function which will be called by button onclick handler.
Error View :
This is stopping us from app store submission. What is the fix for this?

Related

Javascript Mouse event isTrusted false on Chrome in Https connection

I am having an issue with chrome on https connection related to MouseEvent isTrusted property.
I have an HTML like
<div id="facebook_share">
<a href="#">
<img src="facebook.png" alt="facebook">
</a>
</div>
Now I am opening a popup with facebook url using following javascript
socialSharePopup = function (link, title) {
window.open(link, title, 'width=400,height=380');
};
documentUrl = document.URL;
documentMetaDesc = getMetadata("description");
facebookLink = "https://www.facebook.com/sharer/sharer.php?u=" + documentUrl;
facebookLinkEle = document.getElementById("facebook_share");
if (facebookLinkEle !== null) {
facebookLinkEle.onclick = function (event) {
//event.isTrusted is false on chrome on https
socialSharePopup(facebookLink, 'Facebook');
if (event) { //If Condition used for IE8
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
}
};
}
Now the issue I am facing is, on chrome when this page is opened on https connection then a popup blocker is opened first time and popup opens when clicked second time without making any changes. I find this behavior weird.
When the same site is opened on http connection then it working fine and no popup is blocked.
Same result happens when website is opened on https with untrusted connection (on local with no certificate)
Upon debugging I find that MouseEvent.isTrusted (event.isTrusted) property is false in case of popup is blocked on https
What is the relation between isTrusted and https connection ? Why its false only on https ? And why only first time ?
Its working fine on Firefox and IE
One more observation is that when user clicks happens on div#facebook_share it works fine (event.isTrusted is true) but when click happens on <a> tag its false.
Removing <a> tag is not an option as HTML is dynamically generated
How can this issue be resolved ?

Notification in Tizen wearable web app to display the UI of app running in background

In the tizen wearable web application that I am developing, I need my application to prompt a notification to the user every 10min to go into the same application and give some sort of input from the app UI.
I am currently using a simple status notification from notification API which gives a notification having link to the current application. When user clicks on it, the application is launched again (as it does according to description in simple status notifiation).
But I don't want the application to be restarted by clicking on the notification. Instead it should get the application running background to display on the watch UI.
Please let me know any possible solutions to achieve this.
Below is the code I am using right now.
var myappInfo = tizen.application.getAppInfo();
var notificationDict = {
content : "Please enter your response.",
iconPath : "images/icon.png",
vibration : true,
soundPath : "music/solemn.mp3",
appId : myappInfo.id
};
currentBatteryLevelNotification = new(tizen.StatusNotification("SIMPLE",
"Your input required!", notificationDict);
tizen.notification.post(currentBatteryLevelNotification);
I tried playing with your code, got some progress using:
AppContextId
var myappInfo = tizen.application.getAppContext();
//appId : myappInfo.id or muappInfo.appId
and Moving app to background:
document.addEventListener('tizenhwkey', function(e) {
if(e.keyName === "back") {
try {
tizen.application.getCurrentApplication().hide();
//instead of tizen.application.getCurrentApplication().exit();
} catch (ignore) {
}
}
});
config.xml:
<tizen:setting background-support="enable" encryption="disable" hwkey-event="enable"/>
Tip: If you don't add background-support for Web application, it just dies once you are on exit, It's not possible to get current state.
But I assume the answer is No. May be Notification API is not designed to launch running application I guess.

Handling popups inside casperjs test

I'm trying to make a test for a login webpage where there is the possibility of using Thirdparties social login. When you click on facebook icon, for example, a new popup appears asking for user/password. I'm using waitForPopup and withPopup as specified by the documentation to handle that, but is not working. Is never finding the element (via xpath) inside the xpath, so I can never log in using facebook in our test.
This is an example code that check if the facebook button is there, click on it and wait for the popup:
casper.then(function() {
test.comment("When we click facebook button");
casper.waitForSelector(x(facebookButton), function() {
test.assertExists(x(facebookButton), "Facebook icon is showing");
casper.click(x(facebookButton));
}, function timeout() { // step to execute if check has failed
casper.test.fail("Timeout loading login page");
});
});
casper.then(function() {
casper.waitForPopup(/facebook\.com\/login/, function() {
test.comment("And we fill facebook login info");
casper.withPopup(/facebook\.com\/login/, function() {
this.viewport(1600, 900);
casper.sendKeys(x(facebookEmail), facebookLogin[0]);
casper.sendKeys(x(facebookPassword), facebookLogin[1]);
casper.click(x(facebookLogin));
});
}, function timeout() { // step to execute if check has failed
casper.test.fail("Timeout loading faceebook login");
});
});
The output of the test is:
# When we click facebook button
PASS Facebook icon is showing
# And we fill facebook login info
FAIL Cannot get informations from xpath selector: //input[#id='email']: element not found.
# type: uncaughtError
# file: casper/import-login-testing.js:1058
# error: Cannot get informations from xpath selector: //input[#id='email']: element not found.
# CasperError: Cannot get informations from xpath selector: //input[#id='email']: element not found.
# at getElementInfo (/Users/ginogalotti/testing-presentation/node_modules/casperjs/modules/casper.js:1058)
# at /Users/ginogalotti/testing-presentation/node_modules/casperjs/modules/casper.js:1589
# at casper/import-login-testing.js:84
# at runStep (/Users/ginogalotti/testing-presentation/node_modules/casperjs/modules/casper.js:1553)
# at checkStep (/Users/ginogalotti/testing-presentation/node_modules/casperjs/modules/casper.js:399)
# stack: not provided
For me, that means that is finding the popup, the waitForPopup is triggering and is just not using the popup to look for the facebookEmail element. I'm still learning about casperjs, so probably this is not even the best way to approach the problem; but I would really thank some guidance.
Thanks in advance,
Example website that I'm testing: https://import.io/login

unable to click submit button using casperjs

I'm filling a form using casperjs and getting stuck at its submission. Below is my code snippet:
this.then(function(){
this.waitUntilVisible('#ajaxSignin', function(){
this.capture("snapss.png");
this.fill('form#ajaxSignin', {
'j_username' : 'testings123testings#gmail.com',
'j_password' : '1234rewq'
}, true);
});
});
this.thenClick('#signin_submit');
this.then(function(){
this.wait(10000, function(){
this.capture('sn8.png');
});
});
In the image 'sn8.png', I'm getting this: "HTTP Status 405 - Request method POST not supported".
So I infer that there is something wrong in clicking the submit button. The script works fine till form filling.(site link: 'http://www.snapdeal.com/product/haier-le22t1000-22-inches-hd/1380076?pos=0;372')
this.waitUntilVisible('#ajaxSignin', function(){
this.capture("snapss.png");
this.fill('form#ajaxSignin', {
'j_username' : 'testings123testings#gmail.com',
'j_password' : '1234rewq'
}, true); // change this to false true will sumbit the
// form right after the input was set
You are submitting the form before you click on the #signin_submit button.

Exit from application via button in titanium

I am very new to titanium when i am trying to exit from the application by clicking the button it displays the titanium splash screen again!!
I am using the following code
var win=Ti.UI.createWindow({
backgroundColor:'#ddd',
exitOnClose:true
});
var button=Ti.UI.createButton({
title:'back',
left:10,top:10
});
button.addEventListener('click',function(e){
win.close();
});
var text=Ti.UI.createLabel({
text:'Home page',
color:'#000',
font:{ fontSize:20}
});
win.add(button);
win.add(text);
win.open();
How can I exit from the application through button click?
You can simply close the application by adding following property to the first window of your application.
exitOnClose: true
and then type the following code where you close your window
win.close();
var activity = Titanium.Android.currentActivity;
activity.finish();
Reference : Exit from Titanium Application Android.
Hope it solved your problem!!