Javascript “Polyfill” to make Chrome behave as IE5/IE6 [closed]












3















Strange request, I know.



We have a system written 15+ years ago that works only in IE with compatibility mode for IE5. Some of the things that don't work in newer browsers are related to the Javascript engine behaving in a very different way (there are many more issues, but this is the one I'm focusing on right now).



For example, you can do something like



document.frames


I can make this work in Chrome by extending the prototype of the HTMLDocument DOM object, something like:



Object.defineProperty(HTMLDocument.prototype, "frames", { get: function () { return document.getElementsByTagName("iframe"); } })


Obviously this won't work for every scenario but it will certainly speed up the process (and prevent having to modify half a million lines of JS).
(Hopefully) this is not a final solution (or the most elegant one) but it can be an initial step to get it working fast before beginning a real refactoring.



I don't expect me being the first person with this approach to make an old app work on new browsers therefore I was wondering how do I solve this in a general way without writing a rule for every IE-specific property/method.



Thanks.










share|improve this question















closed as off-topic by CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon Nov 26 '18 at 19:09


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon

If this question can be reworded to fit the rules in the help center, please edit the question.

















  • Interesting question, but too bad library requests are off-topic

    – CertainPerformance
    Nov 22 '18 at 1:58











  • What's the application that you need to get working? What other specific issues does it have? Tampermonkey or something might be your best bet. I don't think you'll find some sort of blanket compatibility mode.

    – Brad
    Nov 22 '18 at 1:59













  • Back in that day there were so many IE specific hacks that had to be written I'd hate to have to reverse engineer those. Wouldn't be surprised you see numerous IE conditional comments in the html that no other browsers honor

    – charlietfl
    Nov 22 '18 at 2:15













  • @CertainPerformance Interesting... one could argue that this is 100% programming-related. -Brad I have access to all the code, it's just too much to try to fix the "right way" at once. -charlietfl they didn't even bother with those, IE was the only browser they ever intended to support.

    – willvv
    Nov 22 '18 at 2:49











  • @willvv It's easy to make this question comply with the rules. Just remove "if thare are any well known JS libraries..." and rephrase your question to sound more like "how do I do this?"

    – slebetman
    Nov 22 '18 at 2:56
















3















Strange request, I know.



We have a system written 15+ years ago that works only in IE with compatibility mode for IE5. Some of the things that don't work in newer browsers are related to the Javascript engine behaving in a very different way (there are many more issues, but this is the one I'm focusing on right now).



For example, you can do something like



document.frames


I can make this work in Chrome by extending the prototype of the HTMLDocument DOM object, something like:



Object.defineProperty(HTMLDocument.prototype, "frames", { get: function () { return document.getElementsByTagName("iframe"); } })


Obviously this won't work for every scenario but it will certainly speed up the process (and prevent having to modify half a million lines of JS).
(Hopefully) this is not a final solution (or the most elegant one) but it can be an initial step to get it working fast before beginning a real refactoring.



I don't expect me being the first person with this approach to make an old app work on new browsers therefore I was wondering how do I solve this in a general way without writing a rule for every IE-specific property/method.



Thanks.










share|improve this question















closed as off-topic by CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon Nov 26 '18 at 19:09


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon

If this question can be reworded to fit the rules in the help center, please edit the question.

















  • Interesting question, but too bad library requests are off-topic

    – CertainPerformance
    Nov 22 '18 at 1:58











  • What's the application that you need to get working? What other specific issues does it have? Tampermonkey or something might be your best bet. I don't think you'll find some sort of blanket compatibility mode.

    – Brad
    Nov 22 '18 at 1:59













  • Back in that day there were so many IE specific hacks that had to be written I'd hate to have to reverse engineer those. Wouldn't be surprised you see numerous IE conditional comments in the html that no other browsers honor

    – charlietfl
    Nov 22 '18 at 2:15













  • @CertainPerformance Interesting... one could argue that this is 100% programming-related. -Brad I have access to all the code, it's just too much to try to fix the "right way" at once. -charlietfl they didn't even bother with those, IE was the only browser they ever intended to support.

    – willvv
    Nov 22 '18 at 2:49











  • @willvv It's easy to make this question comply with the rules. Just remove "if thare are any well known JS libraries..." and rephrase your question to sound more like "how do I do this?"

    – slebetman
    Nov 22 '18 at 2:56














3












3








3








Strange request, I know.



We have a system written 15+ years ago that works only in IE with compatibility mode for IE5. Some of the things that don't work in newer browsers are related to the Javascript engine behaving in a very different way (there are many more issues, but this is the one I'm focusing on right now).



For example, you can do something like



document.frames


I can make this work in Chrome by extending the prototype of the HTMLDocument DOM object, something like:



Object.defineProperty(HTMLDocument.prototype, "frames", { get: function () { return document.getElementsByTagName("iframe"); } })


Obviously this won't work for every scenario but it will certainly speed up the process (and prevent having to modify half a million lines of JS).
(Hopefully) this is not a final solution (or the most elegant one) but it can be an initial step to get it working fast before beginning a real refactoring.



I don't expect me being the first person with this approach to make an old app work on new browsers therefore I was wondering how do I solve this in a general way without writing a rule for every IE-specific property/method.



Thanks.










share|improve this question
















Strange request, I know.



We have a system written 15+ years ago that works only in IE with compatibility mode for IE5. Some of the things that don't work in newer browsers are related to the Javascript engine behaving in a very different way (there are many more issues, but this is the one I'm focusing on right now).



For example, you can do something like



document.frames


I can make this work in Chrome by extending the prototype of the HTMLDocument DOM object, something like:



Object.defineProperty(HTMLDocument.prototype, "frames", { get: function () { return document.getElementsByTagName("iframe"); } })


Obviously this won't work for every scenario but it will certainly speed up the process (and prevent having to modify half a million lines of JS).
(Hopefully) this is not a final solution (or the most elegant one) but it can be an initial step to get it working fast before beginning a real refactoring.



I don't expect me being the first person with this approach to make an old app work on new browsers therefore I was wondering how do I solve this in a general way without writing a rule for every IE-specific property/method.



Thanks.







javascript internet-explorer-6 polyfills






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 18:58







willvv

















asked Nov 22 '18 at 1:57









willvvwillvv

4,650135296




4,650135296




closed as off-topic by CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon Nov 26 '18 at 19:09


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon Nov 26 '18 at 19:09


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – CertainPerformance, Randy Casburn, Paulpro, Icepickle, LGSon

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Interesting question, but too bad library requests are off-topic

    – CertainPerformance
    Nov 22 '18 at 1:58











  • What's the application that you need to get working? What other specific issues does it have? Tampermonkey or something might be your best bet. I don't think you'll find some sort of blanket compatibility mode.

    – Brad
    Nov 22 '18 at 1:59













  • Back in that day there were so many IE specific hacks that had to be written I'd hate to have to reverse engineer those. Wouldn't be surprised you see numerous IE conditional comments in the html that no other browsers honor

    – charlietfl
    Nov 22 '18 at 2:15













  • @CertainPerformance Interesting... one could argue that this is 100% programming-related. -Brad I have access to all the code, it's just too much to try to fix the "right way" at once. -charlietfl they didn't even bother with those, IE was the only browser they ever intended to support.

    – willvv
    Nov 22 '18 at 2:49











  • @willvv It's easy to make this question comply with the rules. Just remove "if thare are any well known JS libraries..." and rephrase your question to sound more like "how do I do this?"

    – slebetman
    Nov 22 '18 at 2:56



















  • Interesting question, but too bad library requests are off-topic

    – CertainPerformance
    Nov 22 '18 at 1:58











  • What's the application that you need to get working? What other specific issues does it have? Tampermonkey or something might be your best bet. I don't think you'll find some sort of blanket compatibility mode.

    – Brad
    Nov 22 '18 at 1:59













  • Back in that day there were so many IE specific hacks that had to be written I'd hate to have to reverse engineer those. Wouldn't be surprised you see numerous IE conditional comments in the html that no other browsers honor

    – charlietfl
    Nov 22 '18 at 2:15













  • @CertainPerformance Interesting... one could argue that this is 100% programming-related. -Brad I have access to all the code, it's just too much to try to fix the "right way" at once. -charlietfl they didn't even bother with those, IE was the only browser they ever intended to support.

    – willvv
    Nov 22 '18 at 2:49











  • @willvv It's easy to make this question comply with the rules. Just remove "if thare are any well known JS libraries..." and rephrase your question to sound more like "how do I do this?"

    – slebetman
    Nov 22 '18 at 2:56

















Interesting question, but too bad library requests are off-topic

– CertainPerformance
Nov 22 '18 at 1:58





Interesting question, but too bad library requests are off-topic

– CertainPerformance
Nov 22 '18 at 1:58













What's the application that you need to get working? What other specific issues does it have? Tampermonkey or something might be your best bet. I don't think you'll find some sort of blanket compatibility mode.

– Brad
Nov 22 '18 at 1:59







What's the application that you need to get working? What other specific issues does it have? Tampermonkey or something might be your best bet. I don't think you'll find some sort of blanket compatibility mode.

– Brad
Nov 22 '18 at 1:59















Back in that day there were so many IE specific hacks that had to be written I'd hate to have to reverse engineer those. Wouldn't be surprised you see numerous IE conditional comments in the html that no other browsers honor

– charlietfl
Nov 22 '18 at 2:15







Back in that day there were so many IE specific hacks that had to be written I'd hate to have to reverse engineer those. Wouldn't be surprised you see numerous IE conditional comments in the html that no other browsers honor

– charlietfl
Nov 22 '18 at 2:15















@CertainPerformance Interesting... one could argue that this is 100% programming-related. -Brad I have access to all the code, it's just too much to try to fix the "right way" at once. -charlietfl they didn't even bother with those, IE was the only browser they ever intended to support.

– willvv
Nov 22 '18 at 2:49





@CertainPerformance Interesting... one could argue that this is 100% programming-related. -Brad I have access to all the code, it's just too much to try to fix the "right way" at once. -charlietfl they didn't even bother with those, IE was the only browser they ever intended to support.

– willvv
Nov 22 '18 at 2:49













@willvv It's easy to make this question comply with the rules. Just remove "if thare are any well known JS libraries..." and rephrase your question to sound more like "how do I do this?"

– slebetman
Nov 22 '18 at 2:56





@willvv It's easy to make this question comply with the rules. Just remove "if thare are any well known JS libraries..." and rephrase your question to sound more like "how do I do this?"

– slebetman
Nov 22 '18 at 2:56












0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?