Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6905205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:09:19+00:00 2026-05-27T08:09:19+00:00

Surprisingly, this Apple page has Element.prototype equal to undefined , so I cannot use

  • 0

Surprisingly, this Apple page has Element.prototype equal to undefined, so I cannot use this awesome snippet of code.

Are there any reason for doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:09:20+00:00Added an answer on May 27, 2026 at 8:09 am

    Apple is using the Coherent JS framework which has this block of code:

    //  Trick picked up from Prototype to get around IE8's fixed Element & Event
    (function() {
      var element = this.Element;
      this.Element = {};
      Object.extend(this.Element, element || {});
    }).call(window);
    

    window.Element is originally a function, but it’s being replaced and extended with a regular object. Only functions have .prototype properties.

    Workaround:

    The prototype chain for any HTML element seems to be:

    • Specific element type (HTMLBodyElement, HTMLDivElement, etc…)
    • HTMLElement
    • Element
    • Node
    • Object

    You should be able to attach your referenced code to the prototype to any of the bold objects in the chain and get the style for an html element. I would not recommend this in production code as modifying objects like that is generally considered harmful, but if you are just trying to export a style from another website, it should work well enough.

    Object.prototype.exportStyles = (function () {   //Works if you use it on an element, the code will protect you from yourself if you try to use it on regular objects.
    HTMLElement.prototype.exportStyles = (function () {   //Safer because it is farther down the inheritance line, affecting fewer objects.
                                                          //Avoiding name collisions and other surprises.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sure there are a million posts about this out there, but surprisingly I'm
Even though the API has been open since Mac OS X Leopard, there's surprisingly,
Surprisingly I was only able to find one previous question on SO about this
Surprisingly as you get good at vim, you can code even faster than standard
Google is surprisingly mute on this issue. In my company's web software error logs,
Sorry if this is an obvious question, but I've found surprisingly few references on
There is surprisingly little information on the internet regarding what Moonlight is exactly from
Well I run a small video website and on the actual video page there
This fails, not surprisingly: >>> 'abc' << 8 Traceback (most recent call last): File
For example I get this as part of a third-party embed code <a class=cs_import>Add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.