Skip to content

Use of deprecated $.browser #14267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jonathanKingston opened this issue Mar 22, 2018 · 7 comments
Closed

Use of deprecated $.browser #14267

jonathanKingston opened this issue Mar 22, 2018 · 7 comments
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@jonathanKingston
Copy link
Contributor

jonathanKingston commented Mar 22, 2018

Preconditions (*)

Steps to reproduce (*)

  1. git grep "$.browser"

Expected result (*)

  1. No use of $.browser

Actual result (*)

app/code/Magento/Checkout/view/frontend/web/js/model/step-navigator.js:                bodyElem = $.browser.safari || $.browser.chrome ? $('body') : $('html');
app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/jquery.ba-bbq.min.js:(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
lib/web/jquery/jquery.ba-hashchange.min.js:(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
lib/web/jquery/jstree/jquery.jstree.js:         // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
lib/web/mage/popup-window.js:                if ($.browser.msie) { // Hacked together for IE browsers

Reopening from: #13799 this is deprecated and still exists in the core, it doesn't look like the hacky usages are needed any more either.

Only lib/web/mage/popup-window.js and app/code/Magento/Checkout/view/frontend/web/js/model/step-navigator.js are actual non lib usage which are old commits (ignoring refactoring etc).

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Mar 22, 2018
@jonathanKingston
Copy link
Contributor Author

Looks like jQuery hashchange is no longer needed for IE9+ support: cowboy/jquery-hashchange#42

@magento-engcom-team
Copy link
Contributor

@jonathanKingston, thank you for your report.
We've acknowledged the issue and added to our backlog.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Mar 23, 2018
@sidolov sidolov added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Mar 23, 2018
@sidolov
Copy link
Contributor

sidolov commented Mar 23, 2018

Hi @jonathanKingston. Thank you for your report.
The issue has been fixed in #14270 by @jonathanKingston in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

magento-engcom-team added a commit that referenced this issue Mar 23, 2018
…in jQuery. Fixes #14267 #14270

 - Merge Pull Request #14270 from jonathanKingston/magento2:2.3-develop_remove-jquery-browser
 - Merged commits:
   1. 6c46def
@osrecio osrecio closed this as completed Mar 24, 2018
@csdougliss
Copy link
Contributor

@osrecio @kirmorozov Was this fixed in 2.3.0 ? I still get it.

@csdougliss csdougliss reopened this Jan 7, 2019
@jaxtheking
Copy link

jaxtheking commented Mar 8, 2019

I can confirm I also get this error on most pages in the BO.

@sdzhepa sdzhepa removed Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jul 31, 2019
@engcom-Delta engcom-Delta self-assigned this Aug 8, 2019
@m2-assistant
Copy link

m2-assistant bot commented Aug 8, 2019

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 8, 2019
@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Aug 8, 2019
@engcom-Delta
Copy link
Contributor

Hi @jonathanKingston thank you for your report. I am not able to reproduce issue by steps you described on 2.3-develop
I got only one usage of $.browser in comment:
lib/web/jquery/jstree/jquery.jstree.js: // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
image

If you'd like to update the issue, please reopen it.

@engcom-Delta engcom-Delta removed their assignment Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

8 participants