Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Userscript for removing bloat from KissAnime site, also adds random features.

KissAnime Cleaner

You guys may have noticed but I've not been updating this for a while and a few pieces are broken. Feel free to update this on your own if you want to or to use Juici's Fork, which he has kindly been keeping more up to date.

This userscript for KissAnime was made for my personal use to remove large chunks of the site that I do not use, including any options to login or use features only for members. Along the way I ended up adding some other small features listed below.

Features

  • Removes any link, tabs, buttons, pages, etc. that I will never use.
    • Also removes ads on any pages that still remain
  • Use up and down arrow keys to navigate suggested search results box on all pages (top right)
  • Fake fullscreen mode toggle with \ key
    • Maintained across page loads, if you make your browser fullscreen with F11 it will look like real fullscreen. Seek bar is hidden in HTML5 player when in fake fullscreen.
  • Configurable Options (Press Home key on keyboard or the option in the User Script Commands menu for KissAnime Cleaner menu)
    • Pause the video on page load
    • Automatically advance to the next video when the current one finishes
      • Option to chooses how many videos to play (-1 for continuous playback)
    • Automatically scroll down some on video pages
    • Resize Video Area to keep it centered and visible in smaller windows
    • Use the arrow keys to go to the previous or next video (only when video is paused)
    • Use the - and = keys to increase and decrease the playback speed for HTML5 player (flash player does not provide support)
    • Player option (flash, html5) moved to KissAnime Clear menu (home key on keyboard)
    • Select preferred quality (should now work for both flash and html5)
      • Will attempt to set quality of video to selected value or next lowest value if selected is not available
    • Set Player Volume

The script also works on KissCartoon and KissAsian.

Usage

Only tested in FireFox with Greasemonkey (should work with Tapermonkey and Chrome).

  • Get Greasemonkey for FireFox if you don't already have it. link
  • Click on the Raw link for kissanime_cleaner.user.js below, wait 5 seconds, and click install to add the script.

Feel free to borrow, modify, and/or steal any of the script for your own needs. No credit is required.

// ==UserScript==
// @name KissAnime Cleaner
// @namespace 9001
// @description Cleans up KissAnime pages. Tested to work with Firefox and Greasemonkey.
// @include https://kissanime.to/*
// @include http://kissanime.to/*
// @include https://kisscartoon.me/*
// @include http://kisscartoon.me/*
// @include https://kissasian.com/*
// @include http://kissasian.com/*
// @version 3.3.15
// @downloadURL https://gist.github.com/crapier/91926a6353207f4524cc/raw/kissanime_cleaner.user.js
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @grant unsafeWindow
// ==/UserScript==
// Prevent script from running in frames and iframes
if (window.top != window.self) {
return;
}
// Get the pages jQuery
var $ = unsafeWindow.jQuery;
// Option constants
var PLAYER_FLASH = 0;
var PLAYER_HTML5 = 1;
// Option variables
var pause_option = GM_getValue("pause", true);
var quality_option = GM_getValue("quality", '1080');
var autoplay_option = GM_getValue("auto", true);
var autoplay_count = GM_getValue("auto_count", -1)
var autoscroll_option = GM_getValue("scroll", true);
var player_option = GM_getValue("player", PLAYER_FLASH);
var resize_option = GM_getValue("resize", true);
var arrow_key_navagation = GM_getValue("arrow_nav", true);
var speed_control = GM_getValue("speed_control", true);
var volume_control = GM_getValue("volume_control", 100);
var remove_login = GM_getValue("remove_login", true);
var remove_comments = GM_getValue("remove_comments", true);
var fake_fullscreen = GM_getValue("fake_fullscreen", false);
// Current page url
var url = document.location.href;
// Regular Expressions to check against for determining what type page currently on and what to clean
var home = /http:\/\/kissanime\.to\/$|https:\/\/kissanime\.to\/$|http:\/\/kisscartoon\.me\/$|https:\/\/kisscartoon\.me\/$|http:\/\/kissasian\.com\/$|https:\/\/kissasian\.com\/$/;
var anime_list = /http:\/\/kissanime\.to\/(AnimeList|Genre|Status|Search|UpcomingAnime)|https:\/\/kissanime\.to\/(AnimeList|Genre|Status|Search|UpcomingAnime)|http:\/\/kisscartoon\.me\/(CartoonList|Status|Genre|Search)|https:\/\/kisscartoon\.me\/(CartoonList|Status|Genre|Search)|http:\/\/kissasian\.com\/(DramaList|Status|Country|Genre|Search)|https:\/\/kissasian\.com\/(DramaList|Status|Country|Genre|Search)/;
var anime_page = /http:\/\/kissanime\.to\/Anime\/[^\/]*$|https:\/\/kissanime\.to\/Anime\/[^\/]*$|http:\/\/kisscartoon\.me\/Cartoon\/[^\/]*$|https:\/\/kisscartoon\.me\/Cartoon\/[^\/]*$|http:\/\/kissasian\.com\/Drama\/[^\/]*$|https:\/\/kissasian\.com\/Drama\/[^\/]*$/;
var video_page = /http:\/\/kissanime\.to\/Anime\/[^\/]*\/[^\/]*\?id=\n*|https:\/\/kissanime\.to\/Anime\/[^\/]*\/[^\/]*\?id=\n*|http:\/\/kisscartoon\.me\/Cartoon\/[^\/]*\/[^\/]*\?id=\n*|https:\/\/kisscartoon\.me\/Cartoon\/[^\/]*\/[^\/]*\?id=\n*|http:\/\/kissasian\.com\/Drama\/[^\/]*\/[^\/]*\?id=\n*|https:\/\/kissasian\.com\/Drama\/[^\/]*\/[^\/]*\?id=\n*/;
//---------------------------------------------------------------------------------------------------------------
// Clean Home page
//---------------------------------------------------------------------------------------------------------------
if (home.test(url)) {
console.log('Performing Cleaning for Home Page');
// Remove Sections from the right side of the page
//Get the rightside from the document
var rightside = document.getElementById('rightside');
// Check if the rightside exist and proceed if it does
if (rightside) {
// Loop through all righside elements
for (var i = 0; i < rightside.childElementCount; i++) {
// Check to make sure element has children
if (rightside.children[i].childElementCount > 0) {
// Check for children that to be removed
if (rightside.children[i].children[0].textContent.search('Remove ads') > 0 ||
rightside.children[i].children[0].textContent.search('Like me please') > 0 ||
rightside.children[i].children[0].textContent.search('omments') > 0) {
// Remove Child if it matches, decrement index to account for removing the child
rightside.removeChild(rightside.children[i--]);
// Check if the next element is a clear2 div and remove it if it is
if (i + 1 > -1 && i + 1 < rightside.childElementCount) {
if (rightside.children[i + 1].className == 'clear2') {
rightside.removeChild(rightside.children[i + 1]);
}
}
}
}
}
}
// Remove Register link in nav sub bar
var navsub = document.getElementById('navsubbar');
if (navsub) {
navsub.children[0].children[0].remove();
navsub.children[0].childNodes[1].remove();
}
//Remove ads
var leftad = document.getElementById('divFloatLeft');
if (leftad) {
leftad.remove();
}
var rightad = document.getElementById('divFloatRight');
if (rightad) {
rightad.remove();
}
var middlead2 = document.getElementById('divAds2');
if (middlead2) {
middlead2.remove();
}
var middlead = document.getElementById('divAds');
if (middlead) {
middlead.remove();
}
// Removes adspaces
var adspace1 = document.getElementById('adsIfrme1');
if (adspace1) {
adspace1.remove();
}
// Remove or hide stubborn ads
var adcheck_count = 0;
var adremover = setInterval(function() {
adcheck_count++;
var body = document.body;
if (body.childElementCount > 1) {
var inital_count = body.childElementCount;
for (var i = inital_count - 1; i > 0 ; i--) {
body.children[i].remove();
}
}
var container = document.getElementById('containerRoot');
var total_elements = container.childElementCount;
for (var i = total_elements - 1; container.children[i].id != 'container' ; i--) {
container.children[i].style.visibility = 'hidden';
container.children[i].style.height = '0px';
container.children[i].style.width = '0px';
}
if (adcheck_count == 50) {
clearInterval(adremover);
}
}, 100);
console.log('Done!');
}
//---------------------------------------------------------------------------------------------------------------
// Clean Anime List Pages
//---------------------------------------------------------------------------------------------------------------
if (anime_list.test(url)) {
console.log('Performing Cleaning for Anime List Pages');
// Remove large spaces left by empty adspace
// Get the ads frame
var adspace = document.getElementById('adsIfrme1');
// If the ad frame was gotten proceed
if (adspace) {
// Check and remove the clear before the adspace
if (adspace.parentElement.previousElementSibling && adspace.parentElement.previousElementSibling.className == 'clear') {
adspace.parentElement.previousElementSibling.remove();
}
// Check and remove the clear a bit after the adspace
if (adspace.parentElement.nextElementSibling && adspace.parentElement.nextElementSibling.nextElementSibling &&
adspace.parentElement.nextElementSibling.nextElementSibling.nextElementSibling &&
adspace.parentElement.nextElementSibling.nextElementSibling.nextElementSibling.className == 'clear') {
adspace.parentElement.nextElementSibling.nextElementSibling.nextElementSibling.remove();
}
// Remove the adspace's parent (and thus it)
adspace.parentElement.remove();
}
//Remove other ads
var leftad = document.getElementById('divFloatLeft');
if (leftad) {
leftad.remove();
}
var rightad = document.getElementById('divFloatRight');
if (rightad) {
rightad.remove();
}
var adspace2 = document.getElementById('adsIfrme2');
if (adspace2) {
adspace2.remove();
}
// Remove or hide stubborn ads
var adcheck_count = 0;
var adremover = setInterval(function() {
adcheck_count++;
var body = document.body;
if (body.childElementCount > 1) {
var inital_count = body.childElementCount;
for (var i = inital_count - 1; i > 0 ; i--) {
body.children[i].remove();
}
}
var container = document.getElementById('containerRoot');
var total_elements = container.childElementCount;
for (var i = total_elements - 1; container.children[i].id != 'container' ; i--) {
container.children[i].style.visibility = 'hidden';
container.children[i].style.height = '0px';
container.children[i].style.width = '0px';
}
if (adcheck_count == 50) {
clearInterval(adremover);
}
}, 100);
console.log('Done!');
}
//---------------------------------------------------------------------------------------------------------------
// Clean Episode List Pages
//---------------------------------------------------------------------------------------------------------------
if (anime_page.test(url)) {
console.log('Performing Cleaning for Episode List Pages');
// Remove large spaces left by empty adspace
// Get the ads frame
var adspace = document.getElementById('adsIfrme1');
// If the ad frame was gotten proceed
if (adspace) {
// Check and remove the clear before the adspace
if (adspace.parentElement.previousElementSibling && adspace.parentElement.previousElementSibling.className == 'clear') {
adspace.parentElement.previousElementSibling.remove();
}
// Check and remove the clear a bit after the adspace
if (adspace.parentElement.nextElementSibling && adspace.parentElement.nextElementSibling.nextElementSibling &&
adspace.parentElement.nextElementSibling.nextElementSibling.nextElementSibling &&
adspace.parentElement.nextElementSibling.nextElementSibling.nextElementSibling.className == 'clear') {
adspace.parentElement.nextElementSibling.nextElementSibling.nextElementSibling.remove();
}
// Remove the adspace's parent (and thus it)
adspace.parentElement.remove();
}
//Remove other ads
var leftad = document.getElementById('divFloatLeft');
if (leftad) {
leftad.remove();
}
var rightad = document.getElementById('divFloatRight');
if (rightad) {
rightad.remove();
}
var middlead = document.getElementById('divAds');
if (middlead) {
middlead.remove();
}
// Remove share stuff from episode list pages
var eplist = $('div.barContent.episodeList')[0].children[1];
if (eplist) {
// Page has episodes
if (eplist.childElementCount > 3) {
// delete all elements before the listings
eplist.children[0].remove();
eplist.children[0].remove();
eplist.children[0].remove();
eplist.children[0].remove();
}
// Page has no episdoes (not aired)
else {
eplist.children[0].remove();
eplist.children[0].remove();
eplist.children[0].remove();
}
}
if (remove_comments) {
// Remove comments
var comment_location = 2;
if (/kissasian/.test(url)) {
comment_location = 3;
}
var comments = $('div.bigBarContainer')[comment_location];
if (comments) {
comments.remove();
}
}
var bookmark_link = document.getElementById('spanBookmark');
if (bookmark_link) {
bookmark_link.remove();
}
// Remove or hide stubborn ads
var adcheck_count = 0;
var adremover = setInterval(function() {
adcheck_count++;
var body = document.body;
if (body.childElementCount > 1) {
var inital_count = body.childElementCount;
for (var i = inital_count - 1; i > 0 ; i--) {
body.children[i].remove();
}
}
var container = document.getElementById('containerRoot');
var total_elements = container.childElementCount;
for (var i = total_elements - 1; container.children[i].id != 'container' ; i--) {
container.children[i].style.visibility = 'hidden';
container.children[i].style.height = '0px';
container.children[i].style.width = '0px';
}
var rightside = document.getElementById('rightside');
total_elements = rightside.childElementCount;
for (var i = total_elements - 1; rightside.children[i].className != 'rightBox' ; i--) {
rightside.children[i].style.visibility = 'hidden';
rightside.children[i].style.height = '0px';
rightside.children[i].style.width = '0px';
}
if (adcheck_count == 50) {
clearInterval(adremover);
}
}, 100);
console.log('Done!');
}
//---------------------------------------------------------------------------------------------------------------
// Clean Video Page
//---------------------------------------------------------------------------------------------------------------
if (video_page.test(url)) {
console.log('Performing Cleaning for Video Page');
// Override functions so they wont be do anything when called by the pages code
// Function to inject into page
var override = function() {
DoDetect2 = function() {}
CheckAdImage = function() {}
}
// Create script to inject
var script1 = document.createElement('script');
script1.type = "text/javascript";
script1.innerHTML = 'var override = ' + override.toString();
// inject the script
document.getElementsByTagName('head')[0].appendChild(script1);
// Call our new function
unsafeWindow.override();
// Removes adspaces
var adspace6 = document.getElementById('adsIfrme6');
if (adspace6) {
adspace6.remove();
}
var adspace7 = document.getElementById('adsIfrme7');
if (adspace7) {
adspace7.remove();
}
var adspace8 = document.getElementById('adsIfrme8');
if (adspace8) {
adspace8.remove();
}
var adspace10 = document.getElementById('adsIfrme10');
if (adspace10) {
adspace10.remove();
}
var adspace11 = document.getElementById('adsIfrme11');
if (adspace11) {
adspace11.remove();
}
var adCheck1 = document.getElementById('adCheck1');
if (adCheck1) {
adCheck1.remove();
}
var adCheck2 = document.getElementById('adCheck2');
if (adCheck2) {
adCheck2.remove();
}
var adCheck3 = document.getElementById('adCheck3');
if (adCheck3) {
adCheck3.remove();
}
var divdownload = document.getElementById('divDownload');
if (divdownload) {
divdownload.remove();
}
var divfilename = document.getElementById('divFileName');
if (divfilename) {
divfilename.remove();
}
// Removes Empty spaces from Video pages
// Remove Clears
var vid_parent = document.getElementById('centerDivVideo').parentElement;
for (var i = 0; i < vid_parent.childElementCount; i++) {
if (vid_parent.children[i].className == 'clear' || vid_parent.children[i].className == 'clear2') {
vid_parent.removeChild(vid_parent.children[i--]);
}
}
vid_parent.children[3].remove();
if (remove_comments) {
// Get the comment section on the video pages
var comments = document.getElementById('btnShowComments');
// If it exist remove it and the element just prior to it also, share stuff of some kind
if (comments) {
comments = comments.parentElement;
comments.previousElementSibling.remove();
comments.previousElementSibling.remove();
comments.previousElementSibling.remove();
comments.remove();
}
// remove comments for kisscartoon site
var alt_comments = document.getElementById('divComments');
if (alt_comments) {
alt_comments.previousElementSibling.remove();
alt_comments.previousElementSibling.remove();
alt_comments.remove();
}
}
// Hide on page quality selector, conflicts with custom menu selector
var page_select_player = document.getElementById('selectPlayer');
if (page_select_player) {
page_select_player.parentElement.style.cssText = 'display:none;';
}
// hide lights off feature that is pointless with ads already removed
var lights_off = document.getElementById('switch');
if (lights_off) {
lights_off.remove();
}
// remove device player link and text
$('.clsTempMSg').remove();
var USE_FLASH_FOR_PAGE;
var YOUTUBE_FLASH_PLAYER;
if (player_option == PLAYER_FLASH) {
if (document.cookie.indexOf('usingFlashV1') < 0) {
// Reload page with correct player
document.cookie = 'usingFlashV1=true;path=/';
document.cookie = 'usingHTML5V1=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
document.location.href = document.location.href;
}
// check if page actually has youtube info
if (unsafeWindow.jwplayer) {
USE_FLASH_FOR_PAGE = true;
YOUTUBE_FLASH_PLAYER = false;
} else if (unsafeWindow.myPlayer) {
USE_FLASH_FOR_PAGE = false;
YOUTUBE_FLASH_PLAYER = false;
} else {
USE_FLASH_FOR_PAGE = true;
YOUTUBE_FLASH_PLAYER = true;
}
} else {
if (document.cookie.indexOf('usingHTML5V1') < 0) {
// Reload page with correct player
document.cookie = 'usingFlashV1=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
document.cookie = 'usingHTML5V1=true;path=/';
document.location.href = document.location.href;
}
// check that page actually has html5 player
if (unsafeWindow.myPlayer) {
USE_FLASH_FOR_PAGE = false;
YOUTUBE_FLASH_PLAYER = false;
} else if (unsafeWindow.jwplayer) {
USE_FLASH_FOR_PAGE = true;
YOUTUBE_FLASH_PLAYER = false;
} else {
USE_FLASH_FOR_PAGE = true;
YOUTUBE_FLASH_PLAYER = true;
}
}
// Flash Player
if (USE_FLASH_FOR_PAGE) {
console.log('Using Flash Player');
if (YOUTUBE_FLASH_PLAYER) {
console.log('Using YouTube Player');
// Functions to inject on page for flash video control
// Fires when youtube player is ready
var onYouTubePlayerReady = function(playerId) {
console.log('Youtube Player Custom Controls Initialized');
if (pause_option) {
embedVideo.pauseVideo();
}
embedVideo.addEventListener('onStateChange', 'check_for_end');
// translate option into youtubes quality strings values
var youtube_quality_option;
if (quality_option == '1080') {
youtube_quality_option = 'hd1080';
} else if (quality_option == '720') {
youtube_quality_option = 'hd720';
} else if (quality_option == '480') {
youtube_quality_option = 'large';
} else if (quality_option == '360') {
youtube_quality_option = 'medium';
}
// set the quality
embedVideo.setPlaybackQuality(youtube_quality_option);
// set the volume
embedVideo.setVolume(volume_control);
// focus on the video (so pressing f will fullscreen)
setTimeout('embedVideo.focus();', 0);
// Force position to be absolute (compatibility with 'Turn Off the Lights')
setTimeout(function() {
if (embedVideo.style.cssText.indexOf("position: relative !important") >= 0) {
embedVideo.style.cssText = embedVideo.style.cssText.substr(0, embedVideo.style.cssText.indexOf("position: relative !important;")) + embedVideo.style.cssText.substr(embedVideo.style.cssText.indexOf("position: relative !important") + 30);
}
}, 100);
}
// Check for end of playback and move to next video
var check_for_end = function(state) {
if (state == 0 && autoplay_option && autoplay_count != 0) {
if (autoplay_count > 0) {
autoplay_count--;
if (autoplay_count == 0) {
autoplay_count = -1;
autoplay_option = false;
}
document.dispatchEvent(update_userscript);
}
var button = document.getElementById('btnNext');
if (button) {
var link = button.parentElement;
document.location.href = link.href;
}
}
}
// Create script to inject
var script2 = document.createElement('script');
script2.type = "text/javascript";
script2.innerHTML = 'var onYouTubePlayerReady = ' + onYouTubePlayerReady.toString() + '\n' +
'var check_for_end = ' + check_for_end.toString() + '\n' +
'var pause_option = ' + pause_option.toString() + '\n' +
'var quality_option = "' + quality_option.toString() + '"\n' +
'var autoplay_option = ' + autoplay_option.toString() + '\n' +
'var autoplay_count = ' + autoplay_count.toString() + '\n' +
'var volume_control = ' + volume_control.toString() + '\n' +
'var update_userscript = new Event("UDUS")';
// Inject the script
document.getElementsByTagName('head')[0].appendChild(script2);
// Update values for userscript before switching to next video
document.addEventListener('UDUS', function(event) {
autoplay_count = unsafeWindow.autoplay_count;
autoplay_option = unsafeWindow.autoplay_option;
GM_setValue("auto", autoplay_option);
GM_setValue("auto_count", autoplay_count);
});
}
else {
console.log('Using jwplayer.');
// Functions to inject on page for flash video control
// Fires when youtube player is ready
var flash_player_controls = function () {
// wait till video is loaded into player
jwplayer().onReady(function() {
console.log("jwplayer custom Controls Initialized");
// change the quality to desired flash option
var available_levels = jwplayer().getQualityLevels();
var level_set = false;
var desired_level = parseInt(quality_option);
// try to find exact quality level
for (var i = 0; i < available_levels.length; i++) {
if (desired_level == parseInt(available_levels[i].label)) {
jwplayer().setCurrentQuality(i);
level_set = true;
break;
}
}
// try to find best level alternate
if (!level_set) {
// check if desired level is lower than all available
if (desired_level < parseInt(available_levels[0].label)) {
jwplayer().setCurrentQuality(0);
}
// check if desired level is higher than all available
else if(desired_level > parseInt(available_levels[available_levels.length - 1].label)) {
jwplayer().setCurrentQuality(available_levels.length - 1);
}
// else find level that is next smallest
else {
for (var i = 0; i < available_levels.length; i++) {
if(desired_level < parseInt(available_levels[i].label)) {
jwplayer().setCurrentQuality(i-1);
break;
}
}
}
}
// pause the video if option is enabled
if (pause_option) {
jwplayer().pause();
}
// settup callback for end of video checks
jwplayer().onComplete(check_for_end);
});
}
// Check for end of playback and move to next video
var check_for_end = function () {
var button = document.getElementById('btnNext');
if (button && autoplay_option && autoplay_count != 0) {
if (autoplay_count > 0) {
autoplay_count--;
if (autoplay_count == 0) {
autoplay_count = -1;
autoplay_option = false;
}
document.dispatchEvent(update_userscript);
}
var link = button.parentElement;
document.location.href = link.href;
}
}
// Create script to inject
var script2 = document.createElement('script');
script2.type = "text/javascript";
script2.innerHTML = 'var flash_player_controls = ' + flash_player_controls.toString() + '\n' +
'var check_for_end = ' + check_for_end.toString() + '\n' +
'var pause_option = ' + pause_option.toString() + '\n' +
'var quality_option = "' + quality_option.toString() + '"\n' +
'var autoplay_option = ' + autoplay_option.toString() + '\n' +
'var autoplay_count = ' + autoplay_count.toString() + '\n' +
'var update_userscript = new Event("UDUS")';
// Inject the script
document.getElementsByTagName('head')[0].appendChild(script2);
// call injected function, hopefully after jwplayer has been settup
setTimeout(function() {
unsafeWindow.flash_player_controls();
},500);
// Update values for userscript before switching to next video
document.addEventListener('UDUS', function(event) {
autoplay_count = unsafeWindow.autoplay_count;
autoplay_option = unsafeWindow.autoplay_option;
GM_setValue("auto", autoplay_option);
GM_setValue("auto_count", autoplay_count);
});
}
}
// HTML5 Player
else {
console.log('Using HTML5 Player');
// move quality select below player
var html_quality_select = document.getElementById('selectQuality');
if (html_quality_select) {
var video_area = document.getElementById('centerDivVideo');
var leftover_text = html_quality_select.parentElement;
var empty_div = document.createElement('div');
video_area.parentElement.insertBefore(html_quality_select, video_area.nextSibling);
video_area.parentElement.insertBefore(empty_div, video_area.nextSibling);
leftover_text.remove();
}
// Functions to inject on page for html5 video control
var html5_video_options = function() {
console.log("HTML5 Player custom Controls Initialized");
// change the quality to desired flash option
var available_levels = $('#selectQuality')[0];
var level_set = false;
var desired_level = parseInt(quality_option);
// try to find exact quality level
for (var i = 0; i < available_levels.length; i++) {
if (desired_level == parseInt(available_levels.options[i].innerHTML)) {
available_levels.selectedIndex = i;
$('#selectQuality').change();
$('.clsTempMSg').remove();
level_set = true;
break;
}
}
// try to find best level alternate
if (!level_set) {
// check if desired level is higher than all available
if (desired_level < parseInt(available_levels.options[available_levels.length - 1].innerHTML)) {
available_levels.selectedIndex = available_levels.length - 1;
$('#selectQuality').change();
$('.clsTempMSg').remove();
}
// check if desired level is lower than all available
else if (desired_level > parseInt(available_levels.options[0].innerHTML)) {
available_levels.selectedIndex = 0;
$('#selectQuality').change();
$('.clsTempMSg').remove();
}
// else find level that is next smallest
else {
for (var i = 0; i < available_levels.length; i++) {
if (desired_level > parseInt(available_levels.options[i].innerHTML)) {
available_levels.selectedIndex = i;
$('#selectQuality').change();
$('.clsTempMSg').remove();
}
}
}
}
if (pause_option) {
my_video_1_html5_api.pause();
}
my_video_1_html5_api.volume = volume_control / 100;
my_video_1_html5_api.addEventListener('ended', html5_video_end);
}
var html5_video_end = function() {
var button = document.getElementById('btnNext');
if (button && autoplay_option && autoplay_count != 0) {
if (autoplay_count > 0) {
autoplay_count--;
if (autoplay_count == 0) {
autoplay_count = -1;
autoplay_option = false;
}
document.dispatchEvent(update_userscript);
}
var link = button.parentElement;
document.location.href = link.href;
}
}
// injected speed controls
var playback_decrease = function() {
my_video_1_html5_api.playbackRate -= 0.25;
}
var playback_increase = function() {
my_video_1_html5_api.playbackRate += 0.25;
}
// Create script to inject
var script2 = document.createElement('script');
script2.type = "text/javascript";
script2.innerHTML = 'var html5_video_options = ' + html5_video_options.toString() + '\n' +
'var html5_video_end = ' + html5_video_end.toString() + '\n' +
'var pause_option = ' + pause_option.toString() + '\n' +
'var quality_option = ' + quality_option.toString() + '\n' +
'var autoplay_option = ' + autoplay_option.toString() + '\n' +
'var autoplay_count = ' + autoplay_count.toString() + '\n' +
'var playback_decrease = ' + playback_decrease.toString() + '\n' +
'var playback_increase = ' + playback_increase.toString() + '\n' +
'var volume_control = ' + volume_control.toString() + '\n' +
'var update_userscript = new Event("UDUS")';
// Inject the script
document.getElementsByTagName('head')[0].appendChild(script2);
// Call the injected script
unsafeWindow.html5_video_options();
// Update values for userscript before switching to next video
document.addEventListener('UDUS', function(event) {
autoplay_count = unsafeWindow.autoplay_count;
autoplay_option = unsafeWindow.autoplay_option;
GM_setValue("auto", autoplay_option);
GM_setValue("auto_count", autoplay_count);
});
}
// Scroll to the Container
if (autoscroll_option) {
document.getElementById('container').scrollIntoView(true);
}
var resize_video_area = function() {
if (fake_fullscreen) {
var resize_width = window.innerWidth;
var resize_height = window.innerHeight;
document.getElementById('container').style.width = "" + (resize_width) + "px";
document.getElementById('adsIfrme').style.width = "" + (resize_width) + "px";
$(".barContent")[0].children[0].style.width = "" + (resize_width) + "px";
document.getElementById('centerDivVideo').style.width = "" + (resize_width) + "px";
document.getElementById('centerDivVideo').style.height = "" + (resize_height) + "px";
if (USE_FLASH_FOR_PAGE) {
document.getElementById('divContentVideo').style.width = "" + (resize_width) + "px";
document.getElementById('divContentVideo').style.height = "" + (resize_height) + "px";
document.getElementById('embedVideo').style.width = "" + (resize_width) + "px";
document.getElementById('embedVideo').style.height = "" + (resize_height) + "px";
} else {
document.getElementById('divContentVideo').style.width = "" + (resize_width) + "px";
document.getElementById('divContentVideo').style.height = "" + (resize_height) + "px";
document.getElementById('my_video_1').style.width = "" + (resize_width) + "px";
document.getElementById('my_video_1').style.height = "" + (resize_height) + "px";
}
var seek_bar = $('.vjs-control-bar');
if (seek_bar.length > 0) {
seek_bar[0].style.visibility = 'hidden';
}
document.getElementById('centerDivVideo').scrollIntoView(true);
document.body.style.overflow = 'hidden';
}
else {
var resize_to = window.innerWidth - 30;
if (resize_to > 970) {
resize_to = 970;
}
document.getElementById('container').style.width = "" + (resize_to) + "px";
document.getElementById('adsIfrme').style.width = "" + (resize_to - 20) + "px";
$(".barContent")[0].children[0].style.width = "" + (resize_to - 40) + "px";
document.getElementById('centerDivVideo').style.width = "" + (resize_to - 40) + "px";
document.getElementById('centerDivVideo').style.height = "" + (resize_to - 40) * 552 / 845 + "px";
if (USE_FLASH_FOR_PAGE) {
document.getElementById('divContentVideo').style.width = "" + (resize_to - 40) + "px";
document.getElementById('divContentVideo').style.height = "" + (resize_to - 40) * 552 / 845 + "px";
document.getElementById('embedVideo').style.width = "" + (resize_to - 40) + "px";
document.getElementById('embedVideo').style.height = "" + (resize_to - 40) * 552 / 845 + "px";
} else {
document.getElementById('divContentVideo').style.width = "" + (resize_to - 40) + "px";
document.getElementById('divContentVideo').style.height = "" + (resize_to - 40) * 552 / 845 + "px";
document.getElementById('my_video_1').style.width = "" + (resize_to - 40) + "px";
document.getElementById('my_video_1').style.height = "" + (resize_to - 40) * 552 / 845 + "px";
}
var seek_bar = $('.vjs-control-bar');
if (seek_bar.length > 0) {
seek_bar[0].style.visibility = 'visible';
}
document.body.style.overflow = 'visible';
}
}
if (resize_option) {
window.addEventListener("resize", resize_video_area);
// wait some for vid to get added to page, and initialy resize it
setTimeout(function() {
resize_video_area();
}, 1000);
}
// Keys listener for navigating between episodes with left and right arrow keys
// Arrow key keycodes
var LEFT_ARROW_KEY = 37;
var RIGHT_ARROW_KEY = 39;
var MINUS_DASH_KEY = 173;
var PLUS_EQUALS_KEY = 61;
var BAR_FORWARD_SLASH_KEY = 220;
var key_listener = function(event) {
// Get which key is pressed
var key_pressed = event.which;
if (arrow_key_navagation) {
// check to make sure video isnt playing
if ((USE_FLASH_FOR_PAGE && YOUTUBE_FLASH_PLAYER && unsafeWindow.embedVideo.getPlayerState() == 2) || (USE_FLASH_FOR_PAGE && !YOUTUBE_FLASH_PLAYER && unsafeWindow.jwplayer().getState() == "PAUSED")
|| (!USE_FLASH_FOR_PAGE && my_video_1_html5_api.paused)) {
// Left arrow key to go to previous video
if (key_pressed == LEFT_ARROW_KEY) {
var button = document.getElementById('btnPrevious');
if (button) {
var link = button.parentElement;
document.location.href = link.href;
}
// Prevent Default Action of scrolling
event.preventDefault();
}
// right arrow key for next video
else if (key_pressed == RIGHT_ARROW_KEY) {
var button = document.getElementById('btnNext');
if (button) {
var link = button.parentElement;
document.location.href = link.href;
}
// Prevent Default Action of scrolling
event.preventDefault();
}
}
}
// Speed controls for HTLM5 player (flash doesn't support atm)
if (speed_control && !USE_FLASH_FOR_PAGE) {
if (key_pressed == MINUS_DASH_KEY && unsafeWindow.my_video_1_html5_api.playbackRate > 0.25) {
unsafeWindow.playback_decrease();
}
if (key_pressed == PLUS_EQUALS_KEY && unsafeWindow.my_video_1_html5_api.playbackRate < 5) {
unsafeWindow.playback_increase();
}
}
if (key_pressed == BAR_FORWARD_SLASH_KEY) {
fake_fullscreen = !fake_fullscreen;
GM_setValue('fake_fullscreen', fake_fullscreen);
resize_video_area();
}
}
// Add the listener for keypresses
document.addEventListener("keydown", key_listener);
console.log('Done!');
}
//---------------------------------------------------------------------------------------------------------------
// Clean All pages
//---------------------------------------------------------------------------------------------------------------
console.log('Performing Cleaning for All Pages')
// Remove share stuff next to search bar
// Get the search element near the top of the page
var search = document.getElementById('search');
// If it exist then proceed to remove the child that is the facebook, share stuff next to it
if (search) {
search.children[0].children[2].remove();
}
// Remove Login at the top of the page
if (remove_login) {
var login = document.getElementById('topHolderBox');
if (login) {
login.remove();
}
}
// Remove Tabs I don't Use
var mobile = document.getElementById('liMobile');
if (mobile) {
mobile.remove();
}
var report_error = document.getElementById('liReportError');
if (report_error) {
report_error.remove();
}
var request_anime = document.getElementById('liRequest');
if (request_anime) {
request_anime.remove();
}
var forum = document.getElementById('liCommunity');
if (forum) {
forum.remove();
}
var faq = document.getElementById('liFAQ');
if (faq) {
faq.remove();
}
var manga = document.getElementById('liReadManga');
if (manga) {
manga.remove();
}
// Remove Footer
var footer = document.getElementById('footer');
if (footer) {
footer.remove();
}
// Remove 'random' hides that appear on the sides of the page, all pages
if ($('div.divCloseBut')) {
$('div.divCloseBut').remove();
}
// Keys listener for Script Menu Options
// Home Key Code
var HOME_KEY = 36;
var menu_open = false;
var menu;
var global_key_listener = function(event) {
// Get which key is pressed
var key_pressed = event.which;
if (key_pressed == HOME_KEY) {
// Prevent Default Action of scrolling to top of page
event.preventDefault();
open_menu();
}
}
var open_menu = function() {
if (!menu_open) {
menu_open = true;
// Make div element for menu
menu = document.createElement('div');
menu.style.cssText = 'color:black;width:250px;height:320px;background-color:white;position:fixed;top:0;bottom:0;left:0;right:0;margin:auto;border:5px solid;border-radius:10px;border-color:#7FCA03;padding:10px;z-index:5;';
menu.innerHTML = '<center><b>KissAnime Cleaner Options</b></center>' +
'<form><input style="margin:2px;" type="checkbox" name="pause" value="true" id="pause_option_box"> Pause Videos on Page Load <br>' +
'<input style="margin:2px;" type="checkbox" name="autoplay" value="true" id="autoplay_option_box"> Automatically Play Next <input style="margin:0px;font-size:111%;font-family:Tahoma,Arial,Helvetica,sans-serif;" type="number" name="autoplaycount" id="autoplay_count" min="-1" max="999"> Video(s) (choose -1 to play all)<br>' +
'<input style="margin:2px;" type="checkbox" name="autoscroll" value="true" id="autoscroll_option_box"> Automatically Scroll Down to Video Area <br>' +
'<input style="margin:2px;" type="checkbox" name="resize" value="true" id="resize_option_box"> Resize Video Area <br>' +
'<input style="margin:2px;" type="checkbox" name="arrow_nav" value="true" id="arrow_nav_box"> Arrow Keys Navigate Between Videos <br>' +
'<input style="margin:2px;" type="checkbox" name="speed_playback" value="true" id="playback_speed_control_box"> Enable HTML5 Playback speed controls <br>' +
'<input style="margin:2px;" type="checkbox" name="remove_login" value="true" id="remove_login_box"> Disable Login <br>' +
'<input style="margin:2px;" type="checkbox" name="remove_comments" value="true" id="remove_comments_box"> Disable Comments <br><br>' +
'<center><b>Player Options</b></center>' +
'<table style="width: 100%;border-collapse:separate;border-spacing:2px;"><tr><td><input style="margin:2px;" type="radio" name="player" value="flash" id="flash_option"> Flash Player</td>' +
'<td align="right"><select style="margin:2px;" id="quality_select">' +
'<option value="360">360p</option>' +
'<option value="480">480p</option>' +
'<option value="720">720p</option>' +
'<option value="1080">1080p</option>' +
'</select></td></tr>' +
'<tr><td><input style="margin:2px;" type="radio" name="player" value="html5" id="html5_option"> HTML5 Player</td>' +
'<td align="right">Volume <input style="margin:0px;font-size:111%;font-family:Tahoma,Arial,Helvetica,sans-serif;" type="number" name="volumepercent" id="volume_percent" min="0" max="100"></td></tr></table>' +
'<center><input style="margin:2px;font-size:111%;font-family:Tahoma,Arial,Helvetica,sans-serif;padding:2px 5px 2px 5px;width:44px;height:27px;line-height:3px;" type="button" value="Save" id="menu_sumbit_button"></center></form>';
// Add menu to page
document.getElementById('containerRoot').appendChild(menu);
// Set menus starting options to current values
// Checkboxes
var pause_option_box = document.getElementById('pause_option_box');
if (pause_option) {
pause_option_box.checked = true;
}
var autoplay_option_box = document.getElementById('autoplay_option_box');
if (autoplay_option) {
autoplay_option_box.checked = true;
}
var resize_option_box = document.getElementById('resize_option_box');
if (resize_option) {
resize_option_box.checked = true;
}
var autoplay_count_input = document.getElementById('autoplay_count');
autoplay_count_input.style.width = '40px';
autoplay_count_input.value = autoplay_count;
var autoscroll_option_box = document.getElementById('autoscroll_option_box');
if (autoscroll_option) {
autoscroll_option_box.checked = true;
}
var arrow_nav_box = document.getElementById('arrow_nav_box');
if (arrow_key_navagation) {
arrow_nav_box.checked = true;
}
var playback_speed_control_box = document.getElementById('playback_speed_control_box');
if (speed_control) {
playback_speed_control_box.checked = true;
}
var remove_login_box = document.getElementById('remove_login_box');
if (remove_login) {
remove_login_box.checked = true;
}
var remove_comments_box = document.getElementById('remove_comments_box');
if (remove_comments) {
remove_comments_box.checked = true;
}
// Player radios
var flash_option = document.getElementById('flash_option');
var html5_option = document.getElementById('html5_option');
if (player_option == PLAYER_FLASH) {
if (flash_option) {
flash_option.checked = true;
}
} else if (player_option == PLAYER_HTML5) {
if (html5_option) {
html5_option.checked = true;
}
}
// Quality select
var quality_select = document.getElementById('quality_select');
if (quality_select) {
quality_select.value = quality_option;
}
var volume_percent_input = document.getElementById('volume_percent');
volume_percent_input.style.width = '40px';
volume_percent_input.value = volume_control;
// Get the save button
var submit_button = document.getElementById('menu_sumbit_button');
// Save the values and close the menu
submit_button.onclick = menu_save;
} else {
menu_save();
}
}
var menu_save = function() {
// Get all of the form choices for checking
var pause_option_box = document.getElementById('pause_option_box');
var autoplay_option_box = document.getElementById('autoplay_option_box');
var autoplay_count_input = document.getElementById('autoplay_count');
var autoscroll_option_box = document.getElementById('autoscroll_option_box');
var resize_option_box = document.getElementById('resize_option_box');
var flash_option = document.getElementById('flash_option');
var html5_option = document.getElementById('html5_option');
var quality_select = document.getElementById('quality_select');
var arrow_nav_box = document.getElementById('arrow_nav_box');
var playback_speed_control_box = document.getElementById('playback_speed_control_box');
var volume_percent_input = document.getElementById('volume_percent');
var remove_login_box = document.getElementById('remove_login_box');
var remove_comments_box = document.getElementById('remove_comments_box');
// Update Greasemonkey stored values for options
GM_setValue("pause", pause_option_box.checked);
GM_setValue("auto", autoplay_option_box.checked);
GM_setValue("scroll", autoscroll_option_box.checked);
GM_setValue("auto_count", parseInt(autoplay_count_input.value));
GM_setValue("resize", resize_option_box.checked);
GM_setValue("arrow_nav", arrow_nav_box.checked);
GM_setValue("quality", quality_select.value);
GM_setValue("speed_control", playback_speed_control_box.checked);
GM_setValue("volume_control", volume_percent_input.value);
GM_setValue("remove_login", remove_login_box.checked);
GM_setValue("remove_comments", remove_comments_box.checked);
// Check which player option is checked
if (flash_option.checked) {
// Update greasemonkey stored value
GM_setValue("player", PLAYER_FLASH);
// Set appropriate cookies
document.cookie = 'usingFlashV1=true;path=/';
document.cookie = 'usingHTML5V1=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
// Reload page if value has changed
if (player_option != PLAYER_FLASH && video_page.test(url)) {
document.location.href = document.location.href;
}
player_option = PLAYER_FLASH;
} else if (html5_option.checked) {
// Update greasemonkey stored value
GM_setValue("player", PLAYER_HTML5);
// Set appropriate cookies
document.cookie = 'usingFlashV1=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
document.cookie = 'usingHTML5V1=true;path=/';
// Reload page if value has changed
if (player_option != PLAYER_HTML5 && video_page.test(url)) {
document.location.href = document.location.href;
}
player_option = PLAYER_HTML5;
}
// Update this pages userscript options
pause_option = pause_option_box.checked;
autoplay_option = autoplay_option_box.checked;
autoscroll_option = autoscroll_option_box.checked;
arrow_key_navagation = arrow_nav_box.checked;
autoplay_count = parseInt(autoplay_count_input.value);
quality_option = quality_select.value;
speed_control = playback_speed_control_box.checked;
// Update unsafeWindow values that might matter if on video pages
if (video_page.test(url)) {
unsafeWindow.autoplay_option = autoplay_option_box.checked;
unsafeWindow.autoplay_count = parseInt(autoplay_count_input.value);
}
menu.remove();
menu_open = false;
}
// Add the listener for keypresses
document.addEventListener("keydown", global_key_listener);
// Also add as GM menu command
GM_registerMenuCommand("Options Menu", open_menu, "o");
// The search results
var search_results = document.getElementById('result_box');
// The search form text box
var search_form = document.getElementById('keyword');
// Current search selection, -1 if nothing
var search_selection = -1;
// used to scroll search results to current highlighted results
var scroll_height = 0;
// Interval for checking if any results match and appear
var navigation_interval;
// Used to count how many times results are checked for before giving up
var navigation_attempts;
// Key codes
var UP_ARROW_KEY = 38;
var DOWN_ARROW_KEY = 40;
var ENTER_KEY = 13;
// Prevent up and down arrow keys from causing the results to refresh
var prevent_key_reg = function(event) {
var key_pressed = event.which;
if (key_pressed == UP_ARROW_KEY || key_pressed == DOWN_ARROW_KEY) {
event.stopPropagation();
}
}
// Add above in the capture phase of event propagation, so it happens first
document.addEventListener('keyup', prevent_key_reg, true);
// Intercept Enter key press to check if anything is selected
var go_to_selection = function(event) {
var key_pressed = event.which;
if (key_pressed == ENTER_KEY) {
// Check if anything is selected
if (search_selection >= 0 && search_selection < search_results.childElementCount) {
// Go to selection
document.location.href = search_results.children[search_selection].href;
// Prevent form submission
event.preventDefault();
}
}
}
document.addEventListener('keydown', go_to_selection);
// Navigate up and down in search results
var navigate_search_results = function(event) {
var key_pressed = event.which;
if (key_pressed == UP_ARROW_KEY) {
if (search_selection > 0) {
search_results.children[search_selection].style.backgroundColor = '';
search_results.children[--search_selection].style.backgroundColor = '#565E66';
scroll_height -= search_results.children[search_selection + 1].clientHeight;
if (search_selection == 0) {
scroll_height = 0;
}
search_results.scrollTop = scroll_height;
}
}
if (key_pressed == DOWN_ARROW_KEY) {
if (search_selection < search_results.childElementCount - 1) {
if (search_selection >= 0) {
search_results.children[search_selection].style.backgroundColor = '';
}
search_results.children[++search_selection].style.backgroundColor = '#565E66';
scroll_height += search_results.children[search_selection - 1].clientHeight;
search_results.scrollTop = scroll_height;
}
}
}
// Checks if there are navigatable results and adds navigate listener
var reset_navigation = function() {
search_selection = -1;
scroll_height = 0;
++navigation_attempts;
if (search_results.childElementCount > 0) {
document.addEventListener('keydown', navigate_search_results);
clearInterval(navigation_interval);
} else {
document.removeEventListener('keydown', navigate_search_results);
if (navigation_attempts >= 10) {
clearInterval(navigation_interval);
}
}
}
// Called everytime search text box input changes to see if there is navigatable results
var try_navigation = function() {
clearInterval(navigation_interval);
navigation_attempts = 0;
navigation_interval = setInterval(reset_navigation, 200);
}
search_form.addEventListener('input', try_navigation);
console.log('Done!');
@ollie713

This comment has been minimized.

Copy link

ollie713 commented Jan 17, 2015

How would I go about editing the autoplay on video completion to only cycle for X number of episodes?

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jan 18, 2015

Edit: @ollie713
I've implemented a basic version of this, haven't stress tested it or anything. Appears to work, plays next X number of videos (I've limited it to 999 to fit in the box), and choosing -1 plays all.

Was a little bit more work that I though, but you should be able to check revision 81 to see what I added, and to modify it if wanted.

@ollie713

This comment has been minimized.

Copy link

ollie713 commented Jan 20, 2015

Well done sir! Thank you for this great userscript and your timely responses. Will recommend it to others 10/10 😄

@strectmar

This comment has been minimized.

Copy link

strectmar commented Jan 25, 2015

Would it be difficult to add an option for automatic full screen?

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jan 26, 2015

It wouldn't be difficult, it would be impossible.... You can't initiate full screen via JavaScript without user input (such as a key press or mouse click) I've looked into in the past, cause I wanted it to be able to do that too. =(.

I could add a hotkey if its requested... but the yt player already has that so it would be kinda redundant (press f while yt player is active target)

@strectmar

This comment has been minimized.

Copy link

strectmar commented Jan 27, 2015

I suppose there is no way to make it the default active target on page load then too, ah well. Thanks for getting back to me on this so quickly and the awesome script.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jan 30, 2015

Based on your comment, and a small bit of googling I've added a single line of code that should make the flash player focused automatically on page load (the htlm5 player doesn't have the same hotkey for fullscreen but I went ahead and made it focused too). So just hitting f after page load should go fullscreen for the flash player. (revision 82)

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 3, 2015

No idea what's going on with the site atm, only html5 player is showing up and a bunch of other stuff looks different...

@rcdailey

This comment has been minimized.

Copy link

rcdailey commented Feb 4, 2015

Site changed today and this plugin is no longer working.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 4, 2015

Everything should be fixed (as of when this is posted on 2/4) (revision 83)
Update your script by redownloading with the raw link.

Fixed/changed some stuff for the HTML5 player as they changed the way they switch between players now. (revision 84)

@Krazzzi

This comment has been minimized.

Copy link

Krazzzi commented Feb 5, 2015

My video doesn't load with this script, altho is does everything else like removing the ads

@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Feb 5, 2015

Is there any way to make the embedded video's horizontal position, as well as that of the episode selection controls, relative to window size? On my 1080p 24 inch monitor, the embedded video is centered in fullscreen but too far to the right if I split the screen into two windows.

Also, with this script, sometimes the video does not appear. Other times, even if it does appear, it will disappear when paused. I have noticed that the video not appearing is more frequent when it autostarting next episode.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 6, 2015

Hmmm... I've never had the video not appear, so debugging that might be a bit hard.
In the console on the video page does it print:

"Performing Cleaning for Video Page"
"Done!"
"Performing Cleaning for All Pages"
"Done!"

if not then the issue is that some part of the script is encountering an error and its not finishing so that might help with debugging.
Which browser are you using? Latest FF and GreaseMoneky or something else?
Which player flash or html5, other settings?
(screenshot of the vid not appearing might help)
Try clearing your cookies for kissanime, and disabling and enabling the script?
Do you have anything else that might affect kissanime, adblockplus or something else (shouldn't be an issue just trying to cover my bases)?

Reproducing bugs is the easiest way to fix them.

About spiting the screen in two what exactly do you mean? Two windows on left and right side? I think I might be able to fix that, either by adjusting style or setting an event for the window resize event. (A screenshot might be helpful)

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 6, 2015

Revision 85:
-Added option to resize video player area, should help keep it centered and visible when the window is smaller (option is in the home menu, enabled by default)
-Disabled arrow key controls when using html5 player as it conflicts with that players controls

@Krazzzi

This comment has been minimized.

Copy link

Krazzzi commented Feb 6, 2015

I tried on both Mozilla and chrome, and the player loads for both, the player is static and says an error has occured, for both browsers
http://gyazo.com/27ee0278f4b1ac1539de40fb192a8d68 -chrome
http://gyazo.com/75c3e21330d96809cf9d7d8fc322c9d2 -chrome console pulled up
http://gyazo.com/0e9106e0a8308df668dea6102e170087 -firefox
http://gyazo.com/11dd096eca9a6800808cc60c63c1a7fa -firefox console pulled up

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 7, 2015

@ Krazzi , the video loads fine without the script correct? It looks like the script is running to completion, so its not that.

Have you tried disabling all the the features in the Home menu?

Is your flash player up to date?

Does the HTML5 Player work?

@intotherainbows

This comment has been minimized.

Copy link

intotherainbows commented Feb 7, 2015

I'm using tampermonkey on chrome to run this script and I'm having the same problem Krazzzi is, after the update to the kissanime site.

edit: The youtube player works if I go into the resolution settings and select 720p or 1080p, but not 360p. However, I'm able to revert back to 360p after choosing either 1080p or 720p.
Also, I'm not sure how to get to the home menu in chrome.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 8, 2015

The home/options menu for script can be accessed by pressing the Home key on your keyboard (as long as your keyboard has it) or from the greasmonkey dropdown when your on any kissanime page (http://i.imgur.com/EhztmTC.png). I'm assuming that tampermonkey has a similar dropdown as it list the function in its api as well.
Try opening it and hitting save to make sure all the setting variables are initialized to valid values.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 8, 2015

Actually I think I've reproduced the bug, it appears chrome doesn't like "default" as an input for setting the quality of the playback (even though its documented in the youtube player api). So in the Home menu with flash selected change it to anything but default, and the video should load.

Also, this is the first time I've tested with chrome/tapermonkey, so I did not realize that the menu appears at the bottom of the page instead of floating in the middle like it does in firefox, I'll try to fix that now.

Edit: (revision 95)
The menu should now appear as intended when pressing the home key on your keyboard (http://goo.gl/bV7O4f). If you don't have a home key the registered menu is here (http://goo.gl/ngKcCn) for tapermonkey.

Make sure to set the flash player quality setting for the script to anything but "default" for chrome/tapermonkey, or if your having the video not loading problem.

@intotherainbows

This comment has been minimized.

Copy link

intotherainbows commented Feb 8, 2015

Edit: Made this comment without refreshing. Thanks for the work, man.

Chrome/Tampermonkey has an options menu, but pressing that doesn't open anything. The home key doesn't seem to work either. Oh well. Thanks for the script regardless.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 8, 2015

Funny thing about the options menu before I fixed it for Chrome, it was actually being appended at the bottom of the page were its almost impossible to notice that it got added...
The style string I was using wasn't getting applied to make it all floaty in the middle of the page like I wanted, cause Chrome/FF don't agree on a single convention for anything. Chrome needed element.style.cssText vs just element.style in FF. Luckily the cssText version works in both so I don't have to do any browser checking for anything (at least not yet).

@Krazzzi

This comment has been minimized.

Copy link

Krazzzi commented Feb 8, 2015

Thank you very much, and at least the code is now universal for the good browsers.

@rcdailey

This comment has been minimized.

Copy link

rcdailey commented Feb 10, 2015

FYI the auto-update URL for this must not include the SHA1 commit hash, so put this into your browser's script plugin as the "Homepage URL":

https://gist.github.com/crapier/91926a6353207f4524cc/raw/kissanime_cleaner.user.js

This will enable the browser plugin to auto-update this script so you don't have to keep pressing "Raw" and doing a manual reinstall.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 11, 2015

@ rcdailey

I think I've added what your talking about, after redownloading (or just adding the line to the script's meta data yourself) it should autoupdate now (at least it did with my test of changing the version up to 2.0).

I use firefox/greasemonkey, not sure if chrome/tapermonkey needs different meta data to check for updates.

@rainentoyama

This comment has been minimized.

Copy link

rainentoyama commented Feb 14, 2015

Hello @crapier... how can I achieve the "Switch to Flash/HTML5 Player" function of Kissanime? I need your help. I have a movie-video streaming sites. Currently, the only option is the Flash Player. I hope you can help me.

@rainentoyama

This comment has been minimized.

Copy link

rainentoyama commented Feb 14, 2015

Hello @crapier... how can I achieve the "Switch to Flash/HTML5 Player" function of Kissanime? I need your help. I have a movie-video streaming sites. Currently, the only Player option is the Flash Player. I hope you can help me.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Feb 15, 2015

@rainentoyama I wont be able to help you as all I am doing is switching bookmarks for a particular site (kissanime.com) which causes it to load a different player. I did not set up these players as I'm not the creators of the site.
This was done on their side. If you want to check how they do it I'd recommend viewing the source on any of Kissanimes video pages as you can see there how they setup and tell the different players where to get the video source.
I'm sorry I can't be of more help as I don't do the setup or anything for Kissanime, I just made a script to adds some other features to their site (the different players not being something I added, that's a feature they already had I just moved the selection of which player you want to use into a different menu so make the page look cleaner).

@sebb7y

This comment has been minimized.

Copy link

sebb7y commented Feb 22, 2015

Hey, thanks a lot for the user script - it's great. But I'm having problems with the first time I try to watch something. It gives me the "An error occurred, please try again later." error on the flash player. Also, I cannot see the flash player - html switch that you guys were talking about above. I made a video of the bug because why not. I'm on opera but same bug is on chrome also.
https://www.youtube.com/watch?v=rHMNQ3K4tUU&feature=youtu.be

PS. Should I bother "learning" JavaScript. Is it a very useful language? I use the internet a lot but I don't know if it would be useful to learn it.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Mar 1, 2015

@sebby7y sorry for the really late response, been busy with school

Options for the plugin can be accessed by pressing the Home key on your keyboard (in the same cluster as ins, del, end, page up, page down on most keyboards), or it should be accessible in the dropdown for greaskmoneky/tapermonkey when your on any kissanime page. (http://goo.gl/0ZTvOY) (http://goo.gl/HQ2lJ3)

The reason you have the "An error occurred, please try again later" bug is because you have not set the flash players quality options in the menu for this script. Some browsers (chrome for sure, possibly safari) don't like the default option of "default" for the quality option, so choose anything but default.

As for the switch for html5/flash its in the options menu for the plugin as well.

Edit. I've changed the default to 1080p so hopefully people wont have this problem in the future, won't help if you already have it installed, you'll have to change the quality option yourself still.

@sebb7y

This comment has been minimized.

Copy link

sebb7y commented Mar 4, 2015

@crapier Cheers!

@pacer3

This comment has been minimized.

Copy link

pacer3 commented Apr 3, 2015

@crapier Any idea why the quality options doesnt show up on my menu?

http://goo.gl/rm79EY

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Apr 3, 2015

@pacer3
I still haven't had a chance to add back that feature yet since they changed to the jwplayer for flash.
I'll get to it as soon as I have free time (prob not this weekend as I have to write several papers)

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Apr 4, 2015

I've added back all of the features now (still haven't written my paper, but that's my own priority problem...)

The quality controls should now work for both players (the new jwplayer for flash, and the same html5 player that's been available).

If there are any bugs or issues please feel free to comment, and I'll try to fix them as soon as possible. I think I've tested most things, but I'm half asleep so who knows...

@pacer3

This comment has been minimized.

Copy link

pacer3 commented Apr 4, 2015

@crapier

Thanks for your prompt response and action :cheers:
Though, personally, i think your work should come first :X

Anyways, i tried it and it showed the quality options for flash. But unfortunately, it doesnt work anymore after that :X As in the flash quality option disappeared again. Then again, it probably is a chrome issue. Please feel free to take a look at it (chrome seems to have alot of issues for kissanime script huh?) if you use chrome, but if not, no worries. I'll just get firefox then.. 😀 I know for one thing is that firefox works with this script as my brother uses KA cleaner on firefox and watches anime everyday without problems XD

PS: thanks for your time and sincere apologies for dragging you to your script instead of having u get your work done first :X Keep up the good work :cheers:

EDIT:
PSS: My sincerest apologies. It seems that the script is working more or less fine. I'm unable to confirm it entirely, but apparently, the video loading problem wasnt with the script. It seems the anime itself doesnt have the source, hence getting the problem. I'd like to verify it with you if that's fine. Thx >.< (http://kissanime.com/Anime/Amaenaide-yo-Katsu)

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Apr 4, 2015

@pacer3
Yeah it looks like that anime is one of the ones that is broken on Kissanime's site right now. Nothing to do with my script as far as I can tell. If you check the home page there is the notice that:

"There are a lot of broken videos and it could take a month or two to fix. We will try our best to fix them as soon as possible."

@pacer3

This comment has been minimized.

Copy link

pacer3 commented Apr 5, 2015

@crapier

Thanks so much for your time and sorry for the trouble >.<
Quick question though. Is there anyway to get the quality options from the menu to pop out again? I mean after I set it, it disappeared upon the next menu summon.

Thanks so much and sorry for being such a big cause of trouble :X

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Apr 5, 2015

@pacer3
Are you saying that the quality level dropdown in the menu disappears? It shouldn't be doing that anymore.. Are you upgraded to version 2.3? Does it look like this image
Can you describe exactly what you do that makes it disappear? Does it disappear on all pages or just video pages? A screenshot or video might be helpful.

I've checked and it seems to be be permanent in both Chrome and Firefox for me, so I'll need more help reproducing the issue.

Edit. Just to be sure we're talking about the same thing there are 3 different places where quality controls will show up, only one of which is made/controlled by this script

  • Kissanime Cleaner Option
    • This is added by the script and on load of each video page the script will set the video pages quality (see below)
  • HTML5 Contols
    • This is the controls for the HTML5 player, this is on all pages when using HTML5, as the HTML5 player did not have a built in quality control feature
  • Flash Controls
    • This is the controls on the flash player that let you change the quality option per video (menu will only pop up if there are more than two options)
@rcdailey

This comment has been minimized.

Copy link

rcdailey commented Apr 6, 2015

I think you have to be careful with your versioning. 2.3 showed up as a downgrade compared to 2.22 (since 22 is greater than 3).

Try doing 2.2.2 -> 2.3.0, or something like that.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Apr 6, 2015

@rcdailey
Weird, I'll keep that in mind, do you know which versioning scheme that greasemoneky/tapermonkey understand?

For the sake of pushing the updated to anyone else whose hasn't updated I'll go ahead and just update it up to ver 3.0.0, after all this is second time the site changed and made me have to update the script a bunch

Edit
According to greasmonkeys wiki versioning is done like link

From now on ill try to maintain MajorChanges.AddedFeature.BugFixes

@pacer3

This comment has been minimized.

Copy link

pacer3 commented Apr 6, 2015

@crapier

Thanks for your assistance once again. I'm not really sure what happened though. I'm running it through tampermonkey on chrome and after I updated it to 2.2.3 and set the quality options, it disappeared on the next reload (was testing it on the link that I posted above). Now that I've just checked it, it had somehow returned to 2.2.2 again. I've retested it after updating to 3.0, but so far no problems. Great work and keep it up. :cheers: 🍺

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Apr 8, 2015

Tsk, Tsk, Tsk... They switched back to Youtube Player for flash, reverted back to old code for that, should work again. (3.1.0)

They currently have there bookmarks backwards (HTML bookmark loads flash player and vice versa), so I'll have to keep a look out to see if they ever correct that. If they do then my script will cause the page to be reloaded continuously to attempt to switch to the right player (or is it the wrong one since they have it backwards...). Either that or the script will be backwards and the extra features I added wont work on the incorrect player.

Edit. Ops forgot to fix the bookmarks from the save menu. Also I went ahead and added the arrow key navigation to the menu so you can disable it if you want. (3.1.1)

@pacer3

This comment has been minimized.

Copy link

pacer3 commented Apr 8, 2015

Great work crpier!! Keep up the good work and hope you make time for your work. :cheers: 🍺

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Apr 9, 2015

Yeah, I did finally manage to get my papers written.

Also I think I should have fixed the menu to be properly sized and exactly the same on all pages, as they introduced a style sheet at some point that caused the menu to appear different on different pages. Namely on the video pages a pure-min.css style sheet made everything smaller, while on other pages there was some overflow out of the floating menu box. (3.1.2)

@CarriePika

This comment has been minimized.

Copy link

CarriePika commented May 8, 2015

This script is great! Worked like a charm! Thanks so much!
I don't know if you use the site at all but I was wondering if you had any plans to include KissCartoon into the usage of this script? I tried adding it to the enabled sites and it mostly works already.
Thanks again! The site works so much quicker with this it's incredible. No more lag and the autoplay feature is a dream come true! Cheers! =D ♥

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented May 8, 2015

Hmm... I was unaware that site even existed. Dont watch American "cartoons" that much. The site layout looks the same as far as the lists and the players and everything. I'll look into getting all of the other stuff working with it if I get some free time (probably, no classes this summer).

Edit
3.2.0 - Finally got around around to adding the regular expression for kisscartoon site, also fixed a few other things on that site
Tell me if I've broke anything.

3.2.1 - Shortened the regular expression

3.2.2 - Seems they finally realized their bookmarks were backwards and fixed it, so I've updated the script to reflect that, also added an extra snippet to clear both bookmarks that determine what gets set if they somehow both get added, If you still have some mix of both players, try saving your options with the menu again from any non video page.

Also all the flash videos seem to be broken for me at the moment, with or without my script activated.
From the kissanime facebook page:
"There is a problems with youtube flash player again, maybe we cannot bring it back. In the mean time please use HTML5 player instead."

@CarriePika

This comment has been minimized.

Copy link

CarriePika commented May 22, 2015

Wow! Thanks so much! It seems to be working like a charm! =D If anything goes sideways I'll let you know. Thanks again! ♥

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jun 6, 2015

3.2.3 - As the youtube flash player has once again been switched back to the jwplayer, I've switched the code back to that for the flash player, haven't checked the kisscartoon site for compatibility yet. It seems to be working for me though

3.2.4 - Fix selecting wrong quality for jwplayer

3.2.5 - Fix not having blank path for cookies in one place (was causing page to be confused about what player to use, if you have broken video pages try deleting your kissanime cookies)

@rcdailey

This comment has been minimized.

Copy link

rcdailey commented Jun 9, 2015

This is the best script ever. Good job crapier!

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jun 12, 2015

┻━┻ ︵ヽ(`□´)ノ︵ ┻━┻
3.2.6 - Reverted back to 3.2.1 and with youtube player as flash player and backwards bookmarks

3.2.7 - Fixed removing page element that broke html5 player code

@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Jul 8, 2015

This seems to be putting the video at the bottom of the page with big black box where the video would have been previously above it. It is also not automatically scrolling to the bottom of the video. I'm running the script using TamperMonkey. I've made sure to disable all other scripts and Chrome extensions (B.T.W. I'm using Chrome lol).

Can anybody help me?

@Krazzzi

This comment has been minimized.

Copy link

Krazzzi commented Jul 8, 2015

read comments above issue was already discussed for chrome, and crapier, think u can add a player option to run the shows at 1.5 x speed and 2 x speed like on youtube? maybe even the slower options as well

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jul 9, 2015

3.3.0 - Added Speed controls for HTML 5 player only (flash player doesn't provide support, looking at the available speed array for all videos it only returns 1). Currently it increases and decreases in increments of 0.25 with a range of 0.25 - 5. Use the - and = keys for decrease and increase respectivley

3.3.1 - Removed some testing console logging

@BDubbB can you be more specific? Have you tried clearing your cookies? A picture or video might help. Also check your log to see if the script is finishing.

@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Jul 11, 2015

Well, I can't show it all in one picture because, as I said, the video player is positioned way below where the player should be. I can do it in two pictures though. Also, I did clear my cookies, but I don't know how to check this log. What log do I check and how do I check it?

Here is what I see when the page loads (it is the full height of a window on my 1080p monitor, at native resolution, minus Chromes bookmarks, URL bar, and tabs which I've cut off):

Without Scrolling Down

And here is what I see when I hit page down (with the same bits cut away):

After Scrolling Down

Thanks a ton for helping me!

P.S.

I tried to put the images inside of inline code so that it didn't take up as much room, but I couldn't figure out how to do it.

Edited by crapier:

  • Made images links to save some space
@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Jul 11, 2015

I think that I've narrowed my problem down to an extension that I use, to dim the screen sometimes, called "Turn Off The Lights". You can find it here:

https://chrome.google.com/webstore/detail/turn-off-the-lights/bfbmjmiodbnnpllbbbfblcplfjjepjdn?hl=en

Is there any way to make the two compatible? The code appears to be open source. Here is a link to it, from what I gather, on GitHub:

https://github.com/turnoffthelights/Turn-Off-the-Lights-Chrome-extension

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jul 14, 2015

Hmm I've just tried installing that plugin and testing in in chrome and can't seem to reproduce the bug. Everything appears to be working fine for me.

As for the log if you hit F12 and switch to the console there should be some stuff printed out by the script along the lines of:

Performing Cleaning for Video Page
Using Flash Player
Done!
Performing Cleaning for All Pages
Done!
Youtube Player Custom Controls Initialized

If all of that is there then that means the script ran through all the way. The only other thing it could be was if some other plugin/script was modifying the page in some way. Are you using adblock plus or some other ad blocking plugin? If so you might try disabling it for kissanime, as I believe a remove all of the ads anyway. (Although I've tested with adblock plus and it works fine still)

Whats weird is I don't ever move to video embed on the page so I don't know how its getting placed down there.

@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Jul 14, 2015

"Hmm I've just tried installing that plugin and testing in in chrome and can't seem to reproduce the bug. Everything appears to be working fine for me."

I think that you might need my settings for the extension (but there are a lot of options, so I don't know the best way to share them). How I know that it is this plugin, unless there is something that I'm missing, is that I worked in incognito mode to disallow all extensions, then I allowed just TamperMonkey. The script runs just fine, and the video displays as it should. Then I allow Turn The Lights Off and refresh the page. Suddenly, the problem occurs. I disallow Turn Off The Lights, problem gone. I'm almost certain that it is Turn Off The Lights; however, as I said, I might just be missing something.

"As for the log if you hit F12 and switch to the console there should be some stuff printed out by the script along the lines of: ... "

I did as you suggested, and this is what I get:

Performing Cleaning for Video Page
VM727:346 Using Flash Player
VM727:626 Done!
VM727:632 Performing Cleaning for All Pages
VM727:949 Done!
VM763:2 Youtube Player Custom Controls Initialized
application.js?_=1436904589104:62 Uncaught TypeError: setup_slideshow_points is not a function
https://www.youtube.com/get_video?cpn=LuE8S1Ti3_iTLfo1&asv=3&el=embedded&t=…ers-Dub%2FEpisode-035%3Fid%3D106148&video_id=non&autoplay=1&noflv=1&fmt=22 Failed to load resource: the server responded with a status of 404 (OK)
Episode-035?id=106148:1033 Uncaught TypeError: Cannot read property 'indexOf' of null
http://cspix.media6degrees.com/orbserv/hbpix?pixId=1598&pcv=45&ptid=100&tpv…anime.com%2FAnime%2FYu-Gi-Oh-Duel-Monsters-Dub%2FEpisode-035%3Fid%3D106148 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
http://addthis.nexac.com/red/pixel?pid=19 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
http://match.adsrvr.org/track/cmf/generic?ttd_pid=addthis&ttd_tpi=1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
http://cc.chango.com/m/at Failed to load resource: net::ERR_NAME_NOT_RESOLVED
http://tags.bluekai.com/site/21176?id=55a56c6bd6cd26bb&limit=0&redir=http%3…su.addthis.com%2Fred%2Fusync%3Fpid%3D11114%26puid%3D%24_BK_UUID%26ssrc%3D1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED

"The only other thing it could be was if some other plugin/script was modifying the page in some way. Are you using adblock plus or some other ad blocking plugin?"

No, I'm running Chrome in incognito mode and disallowing all extensions aside from TamperMonkey and Turn Off The Lights.

EDIT:

I've found the option in Turn Off The Lights that reproduces the bug. I reset my settings and went through them one at a time. Enable this option in the options menu in order to reproduce it:

Options > Advanced Options > Eye Protection > Automatically dim the background when opening a webpage

That reproduces the bug when enabled and stops the bug when disabled.

Thanks a ton for all of your help and patience, btw!

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jul 14, 2015

That's what it was, I've managed to find the problem with that and kind of brute forced a fix. It was setting the css position to relative so I just added as simple check that should remove that css after the video has loaded, if you want to continue using that option. The fix is only for that particular bit of css as I check for an exact string that Turn Off the Lights is using.

Of course you can leave the Light option off, but if you turn it on it should be corrected to the right spot now.

3.3.2 - Fixed compatibility with Turn Off The Lights Auto dim option

@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Jul 15, 2015

I leave it on because my brother has a problem where he keeps getting corneal flash burns every couple of weeks to a month. We share this computer.

I am sooooo thankful for your helpfulness and for going out of your way to fix a minor problem for a single user. You are great, sir!

P.S.

It works perfectly now!

@ebacurio3519

This comment has been minimized.

Copy link

ebacurio3519 commented Jul 21, 2015

do you have the same exact thing for kisscartoon?

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Jul 23, 2015

@ebacurio3519
Last time I checked it actually works for the most part on kisscartoon already. The only issue I had when I tested a minute ago is that some videos don't have a flash version, but it works fine if you switch to html5 in the menu for those videos.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Aug 11, 2015

3.3.3 - Updated regular expression checks to allow script to work on KissAsian, as well as KissAnime and KissCartoon. Also force remove the ads on several KissCartoon pages that are added after page load.

3.3.4 - Updated player bookmarks to match site again.

@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Sep 12, 2015

I can't tell if this script is working properly or not on http://kissasian.com/ (KissAnime's Drama site). The player seems to be different (like the html5 player) and has a quality selector which seems to cause the video to have an error if you jump forward using the scrubber. It's also not using the video quality that I have selected through KissAnimeCleaner's options.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Sep 12, 2015

@gaveitatry
Issue 1) Some videos don't seem to have a flash version available, which causes issues with the script trying to initialize for flash. I will attempt to find a way to determine if a video has this issue or not at load the right code for the right player. It might be helpful if you gave me a link to an episode your having problems with.

Issue 2) I believe volume control should be pretty easy to add Ill look into it soon.

@BDubbB
It appears that kissasian still has its bookmarks backwards(causes script to use code for wrong player), I will attempt to fix this soon. (Should be easy)

3.3.5 - Hopefully fixed bookmarks that determine player type across all websites (until they change it). Also slightly improved method of removing banner ads on kisscartoon. This should fix @BDubbB issue.
Please tell me if it doesn't.

Still need some links to test for @gaveitatry issue 1

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Sep 14, 2015

@gaveitatry
Can't seem to reproduce your issue, so I'm going to need more info in order to find the problem.
What browser are you using(FF, Chrome, ...), are you using any other plugins that interact with this page. Can you send a screenshot of the page and your settings from the menu? Which player are you using (flash, html5)?

Also can you give me the log printout from your console (F12 -> Console). It should look something like:
Performing Cleaning for Video Page
Using Flash Player
Done!
Performing Cleaning for All Pages
Done!
Youtube Player Custom Controls Initialized

Will work on adding volume controls, but not sure if they will work if the script isn't attaching to the videos players.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Sep 14, 2015

Ahh... none of your modifications are bad in any way... but you might want to look at what I posted for 3.3.4 and 3.3.5 (7 and 5 posts above this respectively). Then look at the changes I made for the corresponding revisions 125-127.

Long story short Kissanime and kisscartoon switched their bookmarks for controlling which player is shown. To my knowledge kissasian hasn't switched yet though. So whichever is easiest for you, remerge my changes or modify my latest version.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Sep 16, 2015

3.3.6 - Video pages now check for available player for page and will function correctly when selected player option is not available for a particular video. Also added volume control to the home menu, volume will be set to percent 0-100 on video load.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Oct 27, 2015

Ahh, sry hadn't noticed. It looks like its the same player they've used in the past occasionally. I should be able to switch my code from the past out for it. Probably won't get to it until the weekend. So you'll have to either switch to the HTML5 player or disable the script for now.

@rcdailey

This comment has been minimized.

Copy link

rcdailey commented Oct 31, 2015

That Flash player is absolutely killing me. I had to disable my adblocker AND this monkey script, simply so I can use the HTML5 player :-(

Also pressing HOME does not open the settings menu. I'm using Chrome.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Oct 31, 2015

Yeah, the script doesn't finish on that page, so if you want to change to HTML5 (in my menu, by accessing with the HOME button) player you can do it from any other Kissanime page (such as the home page or the episode list). I will hopefully fix it tomorrow.

Edit.
3.3.7 - Should now work as intended for the jwplayer flash player. Hopefully it will be backwards compatible for the Youtube flash player if they switch to that again.

@JaffarA

This comment has been minimized.

Copy link

JaffarA commented Nov 5, 2015

Hey guys, kissanime has changed their domain to .to, to compensate go into your script settings, add http://kissanime.to/* to the user included pages, after that go into the edit this user script option and change the following lines:

lines 43, 44, 45 and 46

var home = /http:\/\/kissanime\.com\/$|http:\/\/kisscartoon\.me\/$|http:\/\/kissasian\.com\/$/;
var anime_list = /http:\/\/kissanime\.com\/(AnimeList|Genre|Status|Search|UpcomingAnime)|http:\/\/kisscartoon\.me\/(CartoonList|Status|Genre|Search)|http:\/\/kissasian\.com\/(DramaList|Status|Country|Genre|Search)/;
var anime_page = /http:\/\/kissanime\.com\/Anime\/[\w-]*$|http:\/\/kisscartoon\.me\/Cartoon\/[\w-]*$|http:\/\/kissasian\.com\/Drama\/[\w-]*$/;
var video_page = /http:\/\/kissanime\.com\/Anime\/[\w-]*\/[\w-]*\?id=\n*|http:\/\/kisscartoon\.me\/Cartoon\/[\w-]*\/[\w-]*\?id=\n*|http:\/\/kissasian\.com\/Drama\/[\w-]*\/[\w-]*\?id=\n*/;

change those lines to this. (below)

var home = /http:\/\/kissanime\.to\/$|http:\/\/kisscartoon\.me\/$|http:\/\/kissasian\.com\/$/;
var anime_list = /http:\/\/kissanime\.to\/(AnimeList|Genre|Status|Search|UpcomingAnime)|http:\/\/kisscartoon\.me\/(CartoonList|Status|Genre|Search)|http:\/\/kissasian\.com\/(DramaList|Status|Country|Genre|Search)/;
var anime_page = /http:\/\/kissanime\.to\/Anime\/[\w-]*$|http:\/\/kisscartoon\.me\/Cartoon\/[\w-]*$|http:\/\/kissasian\.com\/Drama\/[\w-]*$/;
var video_page = /http:\/\/kissanime\.to\/Anime\/[\w-]*\/[\w-]*\?id=\n*|http:\/\/kisscartoon\.me\/Cartoon\/[\w-]*\/[\w-]*\?id=\n*|http:\/\/kissasian\.com\/Drama\/[\w-]*\/[\w-]*\?id=\n*/;

paste in place of the original lines 43-46 and it will work again.

@Rhylar

This comment has been minimized.

Copy link

Rhylar commented Nov 5, 2015

Hey guys, just wondering if anyone can edit the script so that comment section and account console is showing up. I cant access my bookmarked animes if I have the script on and I also want to read some funny comments after watching. Will greatly appreciate if someone can help me out...

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Nov 5, 2015

3.3.8 - Updated domain locations as @gathorisx mentioned.
Also made login and comments removal optional (the default is still to remove) for @Rhylar.
To enable them just uncheck the new options in the menu.

I don't actually have an account so I can't test logging in and going to bookmarks/etc. Let me know if there is something else I need to change.

@Rhylar

This comment has been minimized.

Copy link

Rhylar commented Nov 6, 2015

@crapier Thank you for the continuous update with this script and also for the new options for me

@Hardflip

This comment has been minimized.

Copy link

Hardflip commented Nov 10, 2015

The HTML5 will return or it is impossible?

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Nov 11, 2015

@Hardflip you mean the youtube player?
The youtube player was flash, but I don't control which players are available... That's kissanime.

For now I actually would recommend the HTML5 player (currently working for me), as you cant skip ahead with the current flash player (jwplayer).

@Lolrus

This comment has been minimized.

Copy link

Lolrus commented Nov 22, 2015

The script is broken since Kissanime updated their site a few days ago.

@Rhylar

This comment has been minimized.

Copy link

Rhylar commented Nov 22, 2015

@Lolrus I think they just added the new stuff today. It was not like this yesterday. BUT IT IS BROKEN, ads started showing up again. I do not know if it is because the website now uses https:// instead of http:// but its definitely non functioning again. I tried including the same websites but with https:// but ads still showing

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Nov 22, 2015

@Lolrus and @Rhylar
I updated for https, If they changed anything else let me know. It appears to work for me now.

3.3.9 - Quick fix for https, changed regex and include

@Rhylar

This comment has been minimized.

Copy link

Rhylar commented Nov 23, 2015

Thanks @crapier, you sure do take care of your script users. Nothing but respect from me! Thank you

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Nov 26, 2015

@gaveitatry

Just tested on my side and it appears to still be working for me. (besides all the videos taken down my dcma notices). Have you updated to 3.3.9? Are you using FF/greasemonkey or chrome/tapermonkey? Can you tell if the script is even trying to load (greasemonkey tells you which scripts try to run on a page)? If it is running you can check the console to see if the script is printing out anything.

@rayout00

This comment has been minimized.

Copy link

rayout00 commented Nov 29, 2015

Extension works just fine with KissAnime, KissAsian, and KissCartoon, but for some reason, the wrap around layout ads show up on KissCartoon. Is there any chance for a fix on that, just in case whatever they're doing differently on KissCartoon shows up on the other two? Using Firefox/Greasemonkey.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Nov 30, 2015

3.3.10 - Should remove KissCartoon sidebar ads again.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Dec 15, 2015

Thanks, same to everyone who somehow found this script...

@neutonm

This comment has been minimized.

Copy link

neutonm commented Dec 23, 2015

Hey, pretty neat script you got there. Quite handy.

Mind to add auto fullscreen option? When the video ended and "automated" to the next one the fullscreen mode is lost - i'd be cool if fullscreen stays.

PS: If flash player is chosen then auto next episode feature doesn't work. Using script via "Tampermonkey Beta" on Opera.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Dec 23, 2015

Browsers don't let you do automatic fullscreen with javascript. It's a security risk cause, a website might go fullscreen with a fake login prompt or something to steal creditials etc. =(

I'll look into the flash player issue, does it work for the HTML5 player?

@neutonm

This comment has been minimized.

Copy link

neutonm commented Dec 23, 2015

Yeah, no problems with HTML player.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Dec 23, 2015

The flash player goes to the next episode for me with Firefox/greasemonkey and chrome/tampermonkey.
Could you give me more information on you setup?
What settings are you using?
Whats printed in the JavaScript console (CTRL + SHIFT + I, console tab for opera)

@izaankml

This comment has been minimized.

Copy link

izaankml commented Dec 28, 2015

What's the difference between kissanime.io and kissanime.to? Any plans for supporting the .io site? Their facebook says that is the current domain.

@rcdailey

This comment has been minimized.

Copy link

rcdailey commented Dec 28, 2015

I noticed on kissanime.com, using HTML player, the player will sometimes start back at the start of the video again if I attempt to skip through past opening credits and such. I do so by clicking ahead in the progress bar. It never did this before.

I don't use the Flash player because it does not allow skipping.

@crapier

This comment has been minimized.

Copy link
Owner Author

crapier commented Dec 29, 2015

@izaankml
The io site seems to already not have ads, and it only seems to have the html5 player... I'm not sure what the difference between the sites is cause they both look like they are getting updated. I'll look into getting the html5 player stuff to work with it though. No promises.

@rcdailey
I unfortunately have never had this issue (and can't seem to reproduce it)... can you reproduce the bug easily or is it only some of the time? What setting for stuff are you using? Chrome still I assume?

@rcdailey

This comment has been minimized.

Copy link

rcdailey commented Jan 9, 2016

@crapier: I'm using the HTML5 player on chrome. This usually happens if I skip through the video, or if I leave a video sitting paused over night, and then go back to full screen the next day and resume playing.

Hard to get exact steps to reproduce, it doesn't happen consistently.

@BDubbB

This comment has been minimized.

Copy link

BDubbB commented Jan 9, 2016

I was wondering if the html5 player has DASH enabled? I can't seem to pre-load any of the video if my internet is being stupid and slow. That usually only happens with DASH playback (as on YouTube). Is there any way of disabling DASH, if it is enabled, through the script, like YouTube Center Developer Build (have to use developer build, as the regular build hasn't been updated in forever and doesn't really work)?

P.S.

I never did answer you about KissAsian. Yes, your update seems to have fixed the problem with KissAsi