Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions includes/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,15 @@ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer
),
'inline' => array(),
);
// We never cache authenticated user pages, so if they are logged in we
// allow setting of the has_js cookie so batch API functions use the JS
// version.
// user_is_anonymous() is not used here because it is unavailable during
// installation.
// @see user_is_anonymous()
if (!empty($GLOBALS['user']->uid) || !empty($GLOBALS['menu_admin'])) {
$javascript['footer']['inline'][] = array('code' => "document.cookie = 'has_js=1; path=/';", 'defer' => TRUE);
}
}

if (isset($scope) && !isset($javascript[$scope])) {
Expand Down