The 'killswitch' in JavaScript is a pre-jQuery relic. If the browser doesn't support the features we query for, the jQuery will fail horribly anyway. The percentage of browsers not supporting jQuery (but supporting JavaScript) is too low to really be taken serious.

killswitch-1.patch1.93 KBkkaefer
Failed: Failed to apply patch. View


kkaefer’s picture

Status: Active » Needs review
Dries’s picture

Looks good to me but it would be good to have a JavaScript wizard confirm this too.

jjeff’s picture

Looks good to me. I'm all for getting rid of the killswitch.

However, we'll need to be sure to add this removal to the module/theme upgrade documentation.

Also, kkaefer, what's going on with the document.cookie stuff in there? Are we moving from Drupal.settings over to a cookie-based system?

Other than the cookie question, this looks good to me.

markus_petrux’s picture

The cookie is created without explicit domain, that means the cookie will be created under the current domain in the URL. It looks good, but there's an issue here that I would like to mention now that this snippet is being review.

The cookie domain in settings.php can be set to a higher level of the domain being used for the site, and that allows sharing the cookies between subdomains of the same domain. But this cookie "has_js" cannot be shared because it will exist a different version for each subdomain.

If the global $cookie_domain was in Drupal.settings, then it could be used here to create this cookie under the same exact scope the rest of the cookies are created by Drupal.

kkaefer’s picture

This patch is not about the cookie domain at all and doesn't change anything about that. It has been there before and it is still there.

dmitrig01’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good and I tried it and everything works as expected

quicksketch’s picture

Yep, it is time, sorry IE4. It's nice that the introduction of behaviors made this patch so much smaller that it would've been in D5 days. Second this RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Great, thanks for all the reviews folks! I've committed this to HEAD. Marking needs work, as this needs to be reflected in the upgrade documentation, as I'm pretty sure checking for Drupal.jsEnabled is considered a best practice in contrib js files.

Also, markus_petrux's comment at #4 sounds like it's worthy of further discussion. I didn't block this patch for that since kkaefer is right, and it's just moving existing lines of code around, but Markus, could you start another issue to discuss moving this to the Drupal.settings array?

webchick’s picture

Issue tags: +Needs Documentation
markus_petrux’s picture

jhodgdon’s picture

Assigned: Unassigned » jhodgdon

I'm assigning this to myself to add it to the module/theme upgrade guides

jhodgdon’s picture

Status: Needs work » Needs review

I've added information to:
* Module upgrade guide
* Theme upgrade guide (same text)
* Categorical module upgrade page (I marked it as "unknown" as to Coder warning/upgrade status).

If someone could review the text there, that would probably be good... if the text on those pages is OK, it is probably time (I think) to mark this issue as fixed.

jhodgdon’s picture

Assigned: jhodgdon » Unassigned

Status: Needs review » Needs work

The last submitted patch failed testing.

jhodgdon’s picture

Status: Needs work » Needs review

Maybe the bot will ignore it this time...

dmitrig01’s picture

Status: Needs review » Fixed

Looks good

Status: Fixed » Closed (fixed)
Issue tags: -Needs Documentation

Automatically closed -- issue fixed for 2 weeks with no activity.