Answered by:
Reloading pages in edge extension

Question
-
Hi all
Sorry if this is the wrong forum, I couldn't see an Edge development forum in the list.
I want to learn some more about edge extensions so I'm trying to write a basic Hello World extension. I though I would convert some handy javascripts that I have in to extensions so that I can see how they differ and do a bit of learning.
However I'm stumped. My very first "how does this work then" extension was just a basic few lines to reload the current page really to test the loading of an Extension and creating the menu. I never thought the javascript would be the issue. It works in javascript in my PHP, but in Edge it doesn't seem to work, no matter what I do. The extension loads, all that was fine. The context menu appears but when I click the entry nothing happens.
Here's my script.js file from my extension.
browser.contextMenus.create({ id: "HelloWorld", title: "HelloWorld", contexts: ['page'] }); browser.contextMenus.onClicked.addListener(function(info, tab) { if (info.menuItemId == "HelloWorld") { location.reload(true); } });
When I click on the context menu the debug console says this;
HTML1300: Navigation occurred. _generated_background_page.html Current window: HelloWorld_427AE4A3953D462E89096B1EE55ED104/_generated_background_page.html
My guess is that my extension is handily refreshing the background page that the extension runs in rather than the current tab and that I have to get the object reference of the current and reload that. Perhaps an Edge quirk?
Does anyone know why something as simple as a page reload wouldn't work in Edge?
Olly
- Moved by Bill_Stewart Monday, May 1, 2017 3:12 PM Redirecting user
Sunday, April 30, 2017 2:23 PM
Answers
-
For "Edge" development you should post here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/
This forum is for Admin scripting and not for developer issues.
\_(ツ)_/
- Proposed as answer by Dave PatrickMVP Thursday, May 4, 2017 1:28 PM
- Marked as answer by Dave PatrickMVP Saturday, May 6, 2017 2:13 PM
Sunday, April 30, 2017 4:47 PM -
Might try them over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Dave PatrickMVP Thursday, May 4, 2017 1:28 PM
- Marked as answer by Dave PatrickMVP Saturday, May 6, 2017 2:13 PM
Monday, May 1, 2017 4:12 PM
All replies
-
For "Edge" development you should post here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/
This forum is for Admin scripting and not for developer issues.
\_(ツ)_/
- Proposed as answer by Dave PatrickMVP Thursday, May 4, 2017 1:28 PM
- Marked as answer by Dave PatrickMVP Saturday, May 6, 2017 2:13 PM
Sunday, April 30, 2017 4:47 PM -
Thanks. The developer site doesn't seem to be allowing posts at the moment due to an error, so I'll try again during the week.
Olly
Sunday, April 30, 2017 6:04 PM -
Might try them over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Dave PatrickMVP Thursday, May 4, 2017 1:28 PM
- Marked as answer by Dave PatrickMVP Saturday, May 6, 2017 2:13 PM
Monday, May 1, 2017 4:12 PM