• lhttjdr

    (@lhttjdr)


    When a page contains svg element, the Q2W3 plugin will throw an exception. I do not know if that may cause unexpected behavior or not, but it should be fixed I think.

    The following shows the problem. Here is a piece of code from Q2W3 source.

    mutations.forEach( function(mutation) {
    if ( q2w3_exclude_mutations_array( q2w3_sidebar_options ).indexOf( mutation.target.id ) == -1 && mutation.target.className.indexOf( ‘q2w3-fixed-widget-container’ ) == -1 ) {
    q2w3Refresh = true;
    //console.log(‘Mutation detected!’);
    }
    });

    When mutation.target is an svg element, the mutation.target.className will be an instance of SVGAnimatedString instead of Array. Here we can not call indexOf on SVGAnimatedString because it is not defined. Thus the code above will throw an ‘undefined’ exception.

    For svg elements, we need another series of APIs to handle it, because they are so different from general elements.

    • This topic was modified 7 years ago by lhttjdr.
    • This topic was modified 7 years ago by lhttjdr. Reason: change format
Viewing 1 replies (of 1 total)
  • Plugin Contributor Max Bond

    (@max-bond)

    Thank you! I am aware of this problem. Next release will fix this.

Viewing 1 replies (of 1 total)
  • The topic ‘Unsafe access to className’ is closed to new replies.