How to implement a interactive excel web addin with browser

svv 26 Reputation points
2022-06-16T06:19:26.487+00:00

I am implementing a excel web addin. I took a template project(excel web addin) using Visual Studio. Here in code i need to call a URL. that will open in browser popup for login, after login it will have few events like user need to click allow access button. then it will navigate some other URL in same window. now i need to get that URL to my code.

I am able to call the URL and it is opening in browser. but after this i dont any object reference or context to control browser.

Below is the code i written.

SampleNav.js

var w = 800;  
var h = 500;  
var left = (screen.width / 2) - (w / 2);  
var top = (screen.height / 2) - (h / 2);  
var dialog = window.open("myurl", "window1", 'width=' + w + ',height=' + h + ',scrollbars=NO, top=' + top + ', left=' + left);  
console.log("testDialog: " + window.location.pathname);  
console.log("testDialog: " + window.location.hostname);  
console.log("testDialog: " + window.location.assign);  
console.log("testDialog: " + window.location.href);  
console.log("testDialog: " + dialog.location.pathname);  
console.log("testDialog: " + dialog.location.hostname);  
console.log("testDialog: " + dialog.location.assign);  
console.log("testDialog: " + dialog.location.href);  

I tried to find something in dialog reference but no use please suggest needful

Microsoft 365 and Office Development Other
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.