JSFiddle - React, Tailwind, and code Playground

try Get m3u Playlist with document open and new /light /embedded/result path redirecting - forked from abclive_abcnews_com_m3u8_working_v11 ,, Clappr.JS and clappr.min.js via github

by dledle2

HTML

<!-- myPredictJSFiddleVersion=v02

try Get m3u Playlist with document open and new /light /embedded/result path redirecting - forked from abclive_abcnews_com_m3u8_working_v11 ,, Clappr.JS and clappr.min.js via github
// -->
<form id="m3uForm" action="fichier.php" method="post">
  <label for="pseudo">RSS URL</label>
  <input type="text" id="playlists" name="playlists" size="45" value="http://pastebin.com/Y0sDeysd" />
  <input type="submit" id="envoyer" value="Get m3u Playlists" />
</form>
<ul id="result"></ul>

CSS

#m3uplaylist {
      float: right;
      max-width: 45%;
      background-color: #f6f6f6;
      padding: 10px;
    }
    
    ul#result {
      padding: 0;
      list-style-type: none;
      height: 650px;
      overflow-x: hidden;
      overflow-y: scroll;
    }
    
    ul#result li {
      border-bottom: 1px solid #ccc;
      margin: 8px 0
    }
    
    .bold {
      font-weight: bold;
    }

JavaScript

if (location.protocol != 'http:') {
  
try{location.href = 'http:' + window.location.href.substring(window.location.protocol.length);    }catch(e){}

}
else
{
  /* xxx; */
}


if (    window.location.href.toLowerCase().indexOf('/show/light/')  >=0 )    {

try{
window.location.href.toLowerCase().replace('/show/light/','/embedded/result/');   }catch(e){}
}
else
{
  /* xxx; */
}


if (    window.location.href.toLowerCase().indexOf('/show/')  >=0 )    {

try{
window.location.href.toLowerCase().replace('/show/','/embedded/result/');   }catch(e){}
}
else
{
  /* xxx; */
}

var myStrURL='http:' + window.location.href.substring(window.location.protocol.length);
var myStrURL2='http:' + window.location.href.substring(window.location.protocol.length);
var myStrURL3='http:' + window.location.href.substring(window.location.protocol.length);
var myStrURL4='http:' + window.location.href.substring(window.location.protocol.length);
console.log('myStrURL is ' + myStrURL);
console.log('myStrURL2 is ' + myStrURL2);
console.log('myStrURL3 is ' + myStrURL3);
console.log('myStrURL4 is ' + myStrURL4);

if(false){var this_is_a_comment_section='';     
     "http://fiddle.jshell.net/dledle2/n22w112j/show/".replace('/show/','/embedded/result/');
}

myStrURL=myStrURL.replace('/light','');
myStrURL2=myStrURL2.replace('/show/','/embedded/result/');
myStrURL3=myStrURL3.replace('/show/light/','/embedded/result/');
myStrURL4=myStrURL4.replace('/show/light/fichier.php','/embedded/result/');

/* potention case-sensitive issue if i copy/paste to other websites */
console.log('myStrURL (after string replacement) is ' + myStrURL);
console.log('myStrURL2 (after string replacement) is ' + myStrURL2);
console.log('myStrURL3 (after string replacement) is ' + myStrURL3);
console.log('myStrURL4 (after string replacement) is ' + myStrURL4);

/* try{window.open(myStrURL2 , '' , '');    }catch(e){} */
/* try{window.open(myStrURL3 , '' , '');    }catch(e){} */
try{window.open(myStrURL4 , '' , '');   ...