mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 07:47:32 +09:00
waiter waiter more webextensions please
This commit is contained in:
parent
3837792171
commit
bb0adb61ae
10 changed files with 198 additions and 8 deletions
|
|
@ -6,6 +6,7 @@
|
|||
//#define USEWEAKREFS // (haven't quite figured that out yet)
|
||||
|
||||
#include "nsWindowWatcher.h"
|
||||
#include "nsHashPropertyBag.h"
|
||||
#include "nsAutoWindowStateHelper.h"
|
||||
|
||||
#include "nsCRT.h"
|
||||
|
|
@ -1212,6 +1213,29 @@ nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent,
|
|||
// userContextId.
|
||||
MOZ_ASSERT(CheckUserContextCompatibility(newDocShell));
|
||||
|
||||
// If this tab or window has been opened by a window.open call, we have to provide
|
||||
// all the data needed to send a webNavigation.onCreatedNavigationTarget event.
|
||||
if (windowIsNew && parentDocShell && newDocShellItem) {
|
||||
nsCOMPtr<nsIObserverService> obsSvc =
|
||||
mozilla::services::GetObserverService();
|
||||
|
||||
if (obsSvc) {
|
||||
RefPtr<nsHashPropertyBag> props = new nsHashPropertyBag();
|
||||
|
||||
if (uriToLoad) {
|
||||
// The url notified in the webNavigation.onCreatedNavigationTarget event.
|
||||
props->SetPropertyAsACString(NS_LITERAL_STRING("url"),
|
||||
uriToLoad->GetSpecOrDefault());
|
||||
}
|
||||
|
||||
props->SetPropertyAsInterface(NS_LITERAL_STRING("sourceTabDocShell"), parentDocShell);
|
||||
props->SetPropertyAsInterface(NS_LITERAL_STRING("createdTabDocShell"), newDocShellItem);
|
||||
|
||||
obsSvc->NotifyObservers(static_cast<nsIPropertyBag2*>(props),
|
||||
"webNavigation-createdNavigationTarget-from-js", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (uriToLoad && aNavigate) {
|
||||
newDocShell->LoadURI(
|
||||
uriToLoad,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue