      @"AXSelectedTextMarkerRange";
 +#endif
  NSString* const NSAccessibilityTextChangeElement = @"AXTextChangeElement";
- 
- }  // namespace
-@@ -320,8 +322,10 @@
+ NSString* const NSAccessibilityTextEditType = @"AXTextEditType";
+ NSString* const NSAccessibilityTextChangeValue = @"AXTextChangeValue";
+@@ -415,8 +417,10 @@
      focus_object = focus_object->GetClosestPlatformObject();
-     auto native_focus_object = focus_object->ToBrowserAccessibilityCocoa();
-     if (native_focus_object) {
+     auto native_focus_object = ToBrowserAccessibilityCocoa(focus_object);
+     if (native_focus_object && [native_focus_object instanceActive]) {
 +#ifndef MAS_BUILD
        [user_info setObject:[native_focus_object selectedTextMarkerRange]
                      forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];

 }
 
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
index ab84b22..8da47b8 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -201,6 +201,7 @@ class DnsConfigServicePosix::Watcher {
 
   bool Watch() {
     bool success = true;

 extern "C" {
 void CGSSetDenyWindowServerConnections(bool);
 void CGSShutdownServerConnections();
@@ -52,6 +53,7 @@ int sandbox_init_with_parameters(const char* profile,
                                  const char* const parameters[],
                                  char** errorbuf);
 };
+#endif
 
 namespace content {
 namespace {
@@ -142,6 +144,7 @@ NOINLINE void FatalStringQuoteException(const std::string& str) {
 }
 
 bool SandboxCompiler::CompileAndApplyProfile(std::string* error) {
+#ifndef MAS_BUILD
   char* error_internal = nullptr;
   std::vector<const char*> params;
 
@@ -161,6 +164,7 @@ NOINLINE void FatalStringQuoteException(const std::string& str) {
 #pragma clang diagnostic pop
     return false;
   }
+#endif
   return true;
 }
 
@@ -353,6 +357,7 @@ NOINLINE void FatalStringQuoteException(const std::string& str) {
 
   if (sandbox_type == SANDBOX_TYPE_RENDERER &&
       base::mac::IsOSMountainLionOrLater()) {
+#ifndef MAS_BUILD
     // Now disconnect from WindowServer, after all objects have been warmed up.
     // Shutting down the connection requires connecting to WindowServer,
     // so do this before actually engaging the sandbox. This is only done on
@@ -361,6 +366,7 @@ NOINLINE void FatalStringQuoteException(const std::string& str) {
     // be printed to the system logger on certain OS versions.
     CGSSetDenyWindowServerConnections(true);
     CGSShutdownServerConnections();
+#endif
