protected override IAccessible GetDocument()
        {
            var ieServerHwnd = FindDescendantWindows(mHwnd, "Internet Explorer_Server").FirstOrDefault();

            if (ieServerHwnd == default(IntPtr))
            {
                return(null);
            }
            var ieServer = AccessibleObjectHelper.GetAccessibleObjectFromWindow(ieServerHwnd);

            return(ieServer);
        }
Exemple #2
0
        protected override IAccessible GetDocument()
        {
            var chromeRenderHwnd = FindDescendantWindows(mHwnd, "Chrome_RenderWidgetHostHWND").FirstOrDefault();

            if (chromeRenderHwnd == IntPtr.Zero)
            {
                return(null);
            }

            // Chrome only enables accessibility if it gets a top-level IAccessible request, so let's make one first
            var _ = AccessibleObjectHelper.GetAccessibleObjectFromWindow(mHwnd).accName;

            return(AccessibleObjectHelper.FindChild(AccessibleObjectHelper.GetAccessibleObjectFromWindow(chromeRenderHwnd),
                                                    role: AccessibleRole.Document));
        }
        public override string GetWindowUrl()
        {
            var coreWindowHwnd = FindDescendantWindows(mHwnd, "Windows.UI.Core.CoreWindow").FirstOrDefault();

            if (coreWindowHwnd == IntPtr.Zero)
            {
                return(null);
            }

            var addressBar = AccessibleObjectHelper.FindChild(AccessibleObjectHelper.FindChild(AccessibleObjectHelper.GetAccessibleObjectFromWindow(coreWindowHwnd),
                                                                                               role: AccessibleRole.Window),
                                                              role: AccessibleRole.Text);

            if (addressBar == null)
            {
                return(null);
            }
            var address = addressBar.accValue[0];

            if (!address.Contains("://"))
            {
                address = "http://" + address;                 // If we can't tell if it is https or http, default to less secure assumption (insufficient justification to assume secure)
            }

            return(address);
        }
        protected override IAccessible GetDocument()
        {
            var propertyPage = AccessibleObjectHelper.FindChild(AccessibleObjectHelper.FindChild(AccessibleObjectHelper.FindChild(AccessibleObjectHelper.GetAccessibleObjectFromWindow(mHwnd),
                                                                                                                                  role: AccessibleRole.Application),
                                                                                                 role: AccessibleRole.Grouping,
                                                                                                 hasNotState: AccessibleStates.Invisible),
                                                                role: AccessibleRole.PropertyPage,
                                                                hasNotState: AccessibleStates.Offscreen /*(inactive tab)*/);

            var browser = AccessibleObjectHelper.FindChild(propertyPage, customRole: "browser, http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") // Firefox 59+
                          ?? AccessibleObjectHelper.FindChild(propertyPage, customRole: "browser");                                                            // Firefox <59

            return(AccessibleObjectHelper.FindChild(browser, role: AccessibleRole.Document));
        }