Skip to content

Instantly share code, notes, and snippets.

@epleterte
Forked from Zren/watchcartoononline.user.js
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epleterte/4557a84cd3d5d2d7436e to your computer and use it in GitHub Desktop.
Save epleterte/4557a84cd3d5d2d7436e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name watchcartoononline
// @description Description
// @author Chris H (Zren / Shade)
// @icon http://xshade.ca/favicon.ico
// @namespace http://xshade.ca
// @version 1
// @grant none
// @include http://www.watchcartoononline.com/*
// @include http://www.animeuploads.com/embed.php*
// ==/UserScript==
if (document.location.href.match(/^http:\/\/www\.watchcartoononline\.com\/.*/)) {
var iframe = document.querySelector('iframe[id^="frameNewAnimeuploads"]');
if (iframe) {
// Video Browser
// Default to the animeuploads tab.
var tabId = iframe.parentNode.id;
tabId = tabId.substr(0, 'postTabs_'.length) + 'li_' + tabId.substr('postTabs_'.length);
document.querySelector('#' + tabId + ' a').click();
GM_addStyle('#wrap { position: static !important; padding-top: 100vh !important; } iframe[id^="frameNewAnimeuploads"] { position: absolute; top: 0; left: 0; width: 100% !important; height: 100vh !important; }');
}
} else if (document.location.href.match(/^http:\/\/www\.animeuploads\.com\/embed\.php.*/)) {
// Video Host
var submitButton = document.querySelector('form input[type="submit"]');
if (submitButton) {
// GET request
// Submit form
submitButton.click();
} else {
// POST request
// Autoplay video
jwplayer('myJwVideo').play();
GM_addStyle('html, body, #myJwVideo_wrapper, #myJwVideo { width: 100% !important; height: 100% !important; }');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment