Index: src/wp-admin/includes/class-wp-upgrader-skins.php
===================================================================
--- src/wp-admin/includes/class-wp-upgrader-skins.php	(revision 29321)
+++ src/wp-admin/includes/class-wp-upgrader-skins.php	(working copy)
@@ -104,13 +104,22 @@
 		if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) {
 			return;
 		}
-		echo '<script type="text/javascript">
-				(function( wp ) {
-					if ( wp && wp.updates.decrementCount ) {
-						wp.updates.decrementCount( "' . $type . '" );
+
+		if ( defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST ) {
+			echo '<script type="text/javascript">
+					if ( window.postMessage && JSON ) {
+						window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );
 					}
-				})( window.wp );
-			</script>';
+				</script>';
+		} else {
+			echo '<script type="text/javascript">
+					(function( wp ) {
+						if ( wp && wp.updates.decrementCount ) {
+							wp.updates.decrementCount( "' . $type . '" );
+						}
+					})( window.wp );
+				</script>';
+		}
 	}
 }
 
@@ -284,25 +293,6 @@
 		wp_ob_end_flush_all();
 		flush();
 	}
-
-	/**
-	 * Output JavaScript that sends message to parent window to decrement the update counts.
-	 *
-	 * @since 3.9.0
-	 *
-	 * @param string $type Type of update count to decrement. Likely values include 'plugin',
-	 *                     'theme', 'translation', etc.
-	 */
-	protected function decrement_update_count( $type ) {
-		if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) {
-			return;
-		}
-		echo '<script type="text/javascript">
-				if ( window.postMessage && JSON ) {
-					window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );
-				}
-			</script>';
-	}
 }
 
 class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
