code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function mkdtemp() {
return new Promise((resolve, reject) => {
tmp.dir({unsafeCleanup: true}, (err, tmpPath) => {
if (err) {
return reject(err);
}
resolve(tmpPath);
});
});
} | @return {Promise<string>} A promise that resolves to the path. | mkdtemp | javascript | tschaub/gh-pages | test/helper.js | https://github.com/tschaub/gh-pages/blob/master/test/helper.js | MIT |
function setupRepo(fixtureName, options) {
const branch = options.branch || 'gh-pages';
const userEmail = (options.user && options.user.email) || 'user@email.com';
const userName = (options.user && options.user.name) || 'User Name';
return mkdtemp()
.then((dir) => {
const fixturePath = path.join(fixtu... | Creates a git repo with the contents of a fixture.
@param {string} fixtureName Name of fixture.
@param {Object} options Repo options.
@return {Promise<string>} A promise for the path to the repo. | setupRepo | javascript | tschaub/gh-pages | test/helper.js | https://github.com/tschaub/gh-pages/blob/master/test/helper.js | MIT |
function setupRemote(fixtureName, options) {
const branch = options.branch || 'gh-pages';
return setupRepo(fixtureName, options).then((dir) =>
mkdtemp()
.then((remote) => {
return new Git(remote).exec('init', '--bare').then(() => remote);
})
.then((remote) => {
const git = new ... | Creates a git repo with the contents of a fixture and pushes to a remote.
@param {string} fixtureName Name of the fixture.
@param {Object} options Repo options.
@return {Promise} A promise. | setupRemote | javascript | tschaub/gh-pages | test/helper.js | https://github.com/tschaub/gh-pages/blob/master/test/helper.js | MIT |
function assertContentsMatch(dir, url, branch) {
return mkdtemp()
.then((root) => {
const clone = path.join(root, 'repo');
const options = {git: 'git', remote: 'origin', depth: 1};
return Git.clone(url, clone, branch, options);
})
.then((git) => {
const comparison = compare(dir, gi... | @param {string} dir The dir.
@param {string} url The url.
@param {string} branch The branch.
@return {Promise} A promise. | assertContentsMatch | javascript | tschaub/gh-pages | test/helper.js | https://github.com/tschaub/gh-pages/blob/master/test/helper.js | MIT |
function Maplace(args) {
this.VERSION = '@VERSION';
this.loaded = false;
this.markers = [];
this.circles = [];
this.oMap = false;
this.view_all_key = 'all';
this.infowindow = null;
this.maxZIndex = 0;
this.ln = 0;
this.oMap = false;
... | Create a new instance
@class Maplace
@constructor | Maplace | javascript | danielemoraschi/maplace.js | src/maplace.js | https://github.com/danielemoraschi/maplace.js/blob/master/src/maplace.js | MIT |
resolveTests = testComponents => {
if (!isArray(testComponents)) {
return false
}
forEach(testComponents, testComponent => forEach(testComponent, fn => fn()))
} | Calls all reactcards Component tests for mocha/jasmine cli tests
resolveTests calls all component tests instead of having to manually execute all of them
Import all Component tests and resolveTests will run all functions.
import resolveTests from '../../src/utils/resolveTests'
import * as advanced from './a... | resolveTests | javascript | steos/reactcards | src/utils/resolveTests.js | https://github.com/steos/reactcards/blob/master/src/utils/resolveTests.js | BSD-3-Clause |
resolveTests = testComponents => {
if (!isArray(testComponents)) {
return false
}
forEach(testComponents, testComponent => forEach(testComponent, fn => fn()))
} | Calls all reactcards Component tests for mocha/jasmine cli tests
resolveTests calls all component tests instead of having to manually execute all of them
Import all Component tests and resolveTests will run all functions.
import resolveTests from '../../src/utils/resolveTests'
import * as advanced from './a... | resolveTests | javascript | steos/reactcards | src/utils/resolveTests.js | https://github.com/steos/reactcards/blob/master/src/utils/resolveTests.js | BSD-3-Clause |
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [
{
rel: 'preload',
// to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
... | You will need to set publicPath if you plan to deploy your site under a sub path,
for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
then publicPath should be set to "/bar/".
In most cases please use '/' !!!
Detail: https://cli.vuejs.org/config/#publicpath | chainWebpack | javascript | PanJiaChen/vue-admin-template | vue.config.js | https://github.com/PanJiaChen/vue-admin-template/blob/master/vue.config.js | MIT |
createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
}) | constantRoutes
a base page that does not have permission requirements
all roles can be accessed | createRouter | javascript | PanJiaChen/vue-admin-template | src/router/index.js | https://github.com/PanJiaChen/vue-admin-template/blob/master/src/router/index.js | MIT |
createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
}) | constantRoutes
a base page that does not have permission requirements
all roles can be accessed | createRouter | javascript | PanJiaChen/vue-admin-template | src/router/index.js | https://github.com/PanJiaChen/vue-admin-template/blob/master/src/router/index.js | MIT |
function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
} | constantRoutes
a base page that does not have permission requirements
all roles can be accessed | resetRouter | javascript | PanJiaChen/vue-admin-template | src/router/index.js | https://github.com/PanJiaChen/vue-admin-template/blob/master/src/router/index.js | MIT |
generateSign = (params) => {
const keys = Object.keys(params).filter(
(key) => key !== 'format' || key !== 'callback'
);
// params has to be ordered alphabetically
keys.sort();
const o = keys.reduce((r, key) => r + key + params[key], '');
// append secret
return forge.md5
.cre... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | generateSign | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
generateSign = (params) => {
const keys = Object.keys(params).filter(
(key) => key !== 'format' || key !== 'callback'
);
// params has to be ordered alphabetically
keys.sort();
const o = keys.reduce((r, key) => r + key + params[key], '');
// append secret
return forge.md5
.cre... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | generateSign | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
_isAuthRequested = () => {
const token = localStorage.getObject('lastfmtoken');
return token != null;
} | Computes string for signing request
See https://www.last.fm/api/authspec#8 | _isAuthRequested | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
_isAuthRequested = () => {
const token = localStorage.getObject('lastfmtoken');
return token != null;
} | Computes string for signing request
See https://www.last.fm/api/authspec#8 | _isAuthRequested | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static getSession(callback) {
// load session info from localStorage
let mySession = localStorage.getObject('lastfmsession');
if (mySession != null) {
return callback(mySession);
}
// trade session with token
const token = localStorage.getObject('lastfmtoken');
if (toke... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | getSession | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static getUserInfo(callback) {
this.getSession((session) => {
if (session == null) {
callback(null);
return;
}
const params = {
method: 'user.getinfo',
api_key: options.apiKey,
sk: session.key,
};
params.api_sig = generateS... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | getUserInfo | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static updateStatus() {
// auth status
// 0: never request for auth
// 1: request but fail to success
// 2: success auth
if (!_isAuthRequested()) {
status = 0;
return;
}
this.getUserInfo((data) => {
if (data === null) {
status = 1;
} el... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | updateStatus | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static getAuth(callback) {
axios
.get(apiUrl, {
params: {
method: 'auth.gettoken',
api_key: options.apiKey,
format: 'json',
},
})
.then((response) => {
const { data } = response;
const { token } = data;
l... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | getAuth | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static cancelAuth() {
localStorage.removeItem('lastfmsession');
localStorage.removeItem('lastfmtoken');
this.updateStatus();
} | Computes string for signing request
See https://www.last.fm/api/authspec#8 | cancelAuth | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static sendNowPlaying(track, artist, callback) {
this.getSession((session) => {
const params = {
method: 'track.updatenowplaying',
track,
artist,
api_key: options.apiKey,
sk: session.key,
};
params.api_sig = generateSign(params);
p... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | sendNowPlaying | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static scrobble(timestamp, track, artist, album, callback) {
this.getSession((session) => {
const params = {
method: 'track.scrobble',
'timestamp[0]': timestamp,
'track[0]': track,
'artist[0]': artist,
api_key: options.apiKey,
sk: session.key,
... | Computes string for signing request
See https://www.last.fm/api/authspec#8 | scrobble | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static isAuthorized() {
return status === 2;
} | Computes string for signing request
See https://www.last.fm/api/authspec#8 | isAuthorized | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
static isAuthRequested() {
return !(status === 0);
} | Computes string for signing request
See https://www.last.fm/api/authspec#8 | isAuthRequested | javascript | listen1/listen1_chrome_extension | js/lastfm.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/lastfm.js | MIT |
constructor() {
this.playlist = [];
this._random_playlist = [];
this.index = -1;
this._loop_mode = 0;
this._media_uri_list = {};
this.playedFrom = 0;
this.mode = 'background';
this.skipTime = 15;
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | constructor | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
setMode(newMode) {
this.mode = newMode;
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | setMode | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
setRefreshRate(rate = 10) {
clearInterval(this.refreshTimer);
this.refreshTimer = setInterval(() => {
if (this.playing) {
this.sendFrameUpdate();
}
}, 1000 / rate);
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | setRefreshRate | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
get currentAudio() {
return this.playlist[this.index];
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | currentAudio | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
get currentHowl() {
return this.currentAudio && this.currentAudio.howl;
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | currentHowl | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
get playing() {
return this.currentHowl ? this.currentHowl.playing() : false;
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | playing | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
get muted() {
return !!Howler._muted;
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | muted | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
insertAudio(audio, idx) {
if (this.playlist.find((i) => audio.id === i.id)) return;
const audioData = {
...audio,
disabled: false, // avoid first time load block
howl: null,
};
if (idx) {
this.playlist.splice(idx, 0, [audio]);
} else {
this.playlist... | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | insertAudio | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
static array_move(arr, old_index, new_index) {
// https://stackoverflow.com/questions/5306680/move-an-array-element-from-one-array-position-to-another
if (new_index >= arr.length) {
let k = new_index - arr.length + 1;
while (k > 0) {
k -= 1;
arr.push(undefined);
}... | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | array_move | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
insertAudioByDirection(audio, to_audio, direction) {
const originTrack = this.playlist[this.index];
const index = this.playlist.findIndex((i) => i.id === audio.id);
let insertIndex = this.playlist.findIndex((i) => i.id === to_audio.id);
if (index === insertIndex) {
return;
}
... | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | insertAudioByDirection | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
removeAudio(idx) {
if (!this.playlist[idx]) {
return;
}
// restore playing status before change
const isPlaying = this.playing;
const { id: trackId } = this.currentAudio;
if (isPlaying && this.playlist[idx].id === trackId) {
this.pause();
}
this.playlist... | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | removeAudio | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
appendAudioList(list) {
if (!Array.isArray(list)) {
return;
}
list.forEach((audio) => {
this.insertAudio(audio);
});
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | appendAudioList | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
clearPlaylist() {
this.stopAll(); // stop the loadded track before remove list
this.playlist = [];
Howler.unload();
this.sendPlaylistEvent();
this.sendLoadEvent();
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | clearPlaylist | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
stopAll() {
this.playlist.forEach((i) => {
if (i.howl) {
i.howl.stop();
}
});
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | stopAll | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
setNewPlaylist(list) {
if (list.length) {
// stop current
this.stopAll();
Howler.unload();
this.playlist = list.map((audio) => ({
...audio,
howl: null,
}));
// TODO: random mode need random choose first song to load
this.index = 0;
... | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | setNewPlaylist | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
playById(id) {
const idx = this.playlist.findIndex((audio) => audio.id === id);
this.play(idx);
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | playById | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
loadById(id) {
const idx = this.playlist.findIndex((audio) => audio.id === id);
this.load(idx);
} | Player class containing the state of our playlist and where we are in it.
Includes all methods for playing, skipping, updating the display, etc.
@param {Array} playlist Array of objects with playlist song details ({title, file, howl}). | loadById | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
play(idx) {
this.load(idx);
const data = this.playlist[this.index];
if (!data.howl || !this._media_uri_list[data.id]) {
this.retrieveMediaUrl(this.index, true);
} else {
this.finishLoad(this.index, true);
}
} | Play a song in the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to play the first or current). | play | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
retrieveMediaUrl(index, playNow) {
const msg = {
type: 'BG_PLAYER:RETRIEVE_URL',
data: {
...this.playlist[index],
howl: undefined,
index,
playNow,
},
};
MediaService.bootstrapTrack(
msg.data,
(bootinfo) => {
msg... | Play a song in the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to play the first or current). | retrieveMediaUrl | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
load(idx) {
let index = typeof idx === 'number' ? idx : this.index;
if (index < 0) return;
if (!this.playlist[index]) {
index = 0;
}
// stop when load new track to avoid multiple songs play in same time
if (index !== this.index) {
Howler.unload();
}
this.i... | Load a song from the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to load the first or current). | load | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
onload() {
self.currentAudio.disabled = false;
self.sendPlayingEvent('Loaded');
} | Load a song from the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to load the first or current). | onload | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
onend() {
switch (self.loop_mode) {
case 2:
self.skip('random');
break;
case 1:
self.play();
break;
case 0:
default:
self.skip('next');
break;
... | Load a song from the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to load the first or current). | onend | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
onpause() {
navigator.mediaSession.playbackState = 'paused';
self.sendPlayingEvent('Paused');
} | Load a song from the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to load the first or current). | onpause | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
onloaderror(id, err) {
playerSendMessage(this.mode, {
type: 'BG_PLAYER:PLAY_FAILED',
data: err,
});
self.currentAudio.disabled = true;
self.sendPlayingEvent('err');
self.currentHowl.unload();
data.howl = null;
... | Load a song from the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to load the first or current). | onloaderror | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
onplayerror(id, err) {
playerSendMessage(this.mode, {
type: 'BG_PLAYER:PLAY_FAILED',
data: err,
});
self.currentAudio.disabled = true;
self.sendPlayingEvent('err');
} | Load a song from the playlist.
@param {Number} index Index of the song in the playlist
(leave empty to load the first or current). | onplayerror | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
skip(direction) {
Howler.unload();
// Get the next track based on the direction of the track.
const nextIndexFn = (idx) => {
const l = this.playlist.length;
const random_mode = this._loop_mode === 2 || direction === 'random';
let rdx = idx;
if (random_mode) {
... | Skip to the next or previous track.
@param {String} direction 'next' or 'prev'. | skip | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
nextIndexFn = (idx) => {
const l = this.playlist.length;
const random_mode = this._loop_mode === 2 || direction === 'random';
let rdx = idx;
if (random_mode) {
if (this._random_playlist.length / 2 !== l) {
// construction random playlist
const a = Arra... | Skip to the next or previous track.
@param {String} direction 'next' or 'prev'. | nextIndexFn | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
nextIndexFn = (idx) => {
const l = this.playlist.length;
const random_mode = this._loop_mode === 2 || direction === 'random';
let rdx = idx;
if (random_mode) {
if (this._random_playlist.length / 2 !== l) {
// construction random playlist
const a = Arra... | Skip to the next or previous track.
@param {String} direction 'next' or 'prev'. | nextIndexFn | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
set loop_mode(input) {
const LOOP_MODE = {
all: 0,
one: 1,
shuffle: 2,
};
let myMode = 0;
if (typeof input === 'string') {
myMode = LOOP_MODE[input];
} else {
myMode = input;
}
if (!Object.values(LOOP_MODE).includes(myMode)) {
ret... | Skip to the next or previous track.
@param {String} direction 'next' or 'prev'. | loop_mode | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
get loop_mode() {
return this._loop_mode;
} | Skip to the next or previous track.
@param {String} direction 'next' or 'prev'. | loop_mode | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
set volume(val) {
// Update the global volume (affecting all Howls).
if (typeof val === 'number') {
Howler.volume(val);
this.sendVolumeEvent();
this.sendFrameUpdate();
}
} | Set the volume and update the volume slider display.
@param {Number} val Volume between 0 and 1. | volume | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
get volume() {
return Howler.volume();
} | Set the volume and update the volume slider display.
@param {Number} val Volume between 0 and 1. | volume | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
adjustVolume(inc) {
this.volume = inc
? Math.min(this.volume + 0.1, 1)
: Math.max(this.volume - 0.1, 0);
this.sendVolumeEvent();
this.sendFrameUpdate();
} | Set the volume and update the volume slider display.
@param {Number} val Volume between 0 and 1. | adjustVolume | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
mute() {
Howler.mute(true);
playerSendMessage(this.mode, {
type: 'BG_PLAYER:MUTE',
data: true,
});
} | Set the volume and update the volume slider display.
@param {Number} val Volume between 0 and 1. | mute | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
unmute() {
Howler.mute(false);
playerSendMessage(this.mode, {
type: 'BG_PLAYER:MUTE',
data: false,
});
} | Set the volume and update the volume slider display.
@param {Number} val Volume between 0 and 1. | unmute | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
seek(per) {
if (!this.currentHowl) return;
// Get the Howl we want to manipulate.
const audio = this.currentHowl;
// Convert the percent into a seek position.
// if (audio.playing()) {
// }
audio.seek(audio.duration() * per);
} | Seek to a new position in the currently playing track.
@param {Number} per Percentage through the song to skip. | seek | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
seekTime(seconds) {
if (!this.currentHowl) return;
const audio = this.currentHowl;
audio.seek(seconds);
} | Seek to a new position in the currently playing track.
@param {Number} seconds Seconds through the song to skip. | seekTime | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
static formatTime(secs) {
const minutes = Math.floor(secs / 60) || 0;
const seconds = secs - minutes * 60 || 0;
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
} | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | formatTime | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
setMediaURI(uri, url) {
if (url) {
this._media_uri_list[url] = uri;
}
} | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | setMediaURI | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
setAudioDisabled(disabled, idx) {
if (this.playlist[idx]) {
this.playlist[idx].disabled = disabled;
}
} | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | setAudioDisabled | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
async sendFrameUpdate() {
const data = {
id: this.currentAudio ? this.currentAudio.id : 0,
duration: this.currentHowl ? this.currentHowl.duration() : 0,
pos: this.currentHowl ? this.currentHowl.seek() : 0,
playedFrom: this.playedFrom,
playing: this.playing,
};
i... | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | sendFrameUpdate | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
async sendPlayingEvent(reason = 'UNKNOWN') {
playerSendMessage(this.mode, {
type: 'BG_PLAYER:PLAY_STATE',
data: {
isPlaying: this.playing,
reason,
},
});
} | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | sendPlayingEvent | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
async sendLoadEvent() {
playerSendMessage(this.mode, {
type: 'BG_PLAYER:LOAD',
data: {
currentPlaying: {
...this.currentAudio,
howl: undefined,
},
playlist: {
index: this.index,
length: this.playlist.length,
},... | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | sendLoadEvent | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
async sendVolumeEvent() {
playerSendMessage(this.mode, {
type: 'BG_PLAYER:VOLUME',
data: this.volume * 100,
});
} | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | sendVolumeEvent | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
async sendPlaylistEvent() {
playerSendMessage(this.mode, {
type: 'BG_PLAYER:PLAYLIST',
data: this.playlist.map((audio) => ({ ...audio, howl: undefined })),
});
} | Format the time from seconds to M:SS.
@param {Number} secs Seconds to format.
@return {String} Formatted time. | sendPlaylistEvent | javascript | listen1/listen1_chrome_extension | js/player_thread.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/player_thread.js | MIT |
unlock = function (e) {
// Create a pool of unlocked HTML5 Audio objects that can
// be used for playing sounds without user interaction. HTML5
// Audio objects must be individually unlocked, as opposed
// to the WebAudio API which only needs a single activation.
// This must occ... | Some browsers/devices will only allow audio to be played after a user interaction.
Attempt to automatically unlock audio on the first user interaction.
Concept from: http://paulbakaus.com/tutorials/html5/web-audio-on-ios/
@return {Howler} | unlock | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
handleSuspension = function () {
self.state = 'suspended';
if (self._resumeAfterSuspend) {
delete self._resumeAfterSuspend;
self._autoResume();
}
} | Automatically suspend the Web Audio AudioContext after no sound has played for 30 seconds.
This saves processing/energy and fixes various browser-specific bugs with audio getting stuck.
@return {Howler} | handleSuspension | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
Howl = function (o) {
var self = this;
// Throw an error if no source is provided.
if (!o.src || o.src.length === 0) {
console.error(
'An array of source files must be passed with any new Howl.'
);
return;
}
self.init(o);
} | Create an audio group controller.
@param {Object} o Passed in properties for this group. | Howl | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
setParams = function () {
sound._paused = false;
sound._seek = seek;
sound._start = start;
sound._stop = stop;
sound._loop = !!(sound._loop || self._sprite[sprite][2]);
} | Play a sound or resume previous playback.
@param {String/Number} sprite Sprite name for sprite playback or sound id to continue previous.
@param {Boolean} internal Internal Use: true prevents event firing.
@return {Number} Sound ID. | setParams | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
playWebAudio = function () {
self._playLock = false;
setParams();
self._refreshBuffer(sound);
// Setup the playback params.
var vol = sound._muted || self._muted ? 0 : sound._volume;
node.gain.setValueAtTime(vol, Howler.ctx.currentTime);
sound._play... | Play a sound or resume previous playback.
@param {String/Number} sprite Sprite name for sprite playback or sound id to continue previous.
@param {Boolean} internal Internal Use: true prevents event firing.
@return {Number} Sound ID. | playWebAudio | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
playHtml5 = function () {
node.currentTime = seek;
node.muted =
sound._muted || self._muted || Howler._muted || node.muted;
node.volume = sound._volume * Howler.volume();
node.playbackRate = sound._rate;
// Some browsers will throw an error if this is calle... | Play a sound or resume previous playback.
@param {String/Number} sprite Sprite name for sprite playback or sound id to continue previous.
@param {Boolean} internal Internal Use: true prevents event firing.
@return {Number} Sound ID. | playHtml5 | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
listener = function () {
self._state = 'loaded';
// Begin playback.
playHtml5();
// Clear this listener.
node.removeEventListener(Howler._canPlayEvent, listener, false);
} | Play a sound or resume previous playback.
@param {String/Number} sprite Sprite name for sprite playback or sound id to continue previous.
@param {Boolean} internal Internal Use: true prevents event firing.
@return {Number} Sound ID. | listener | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
seekAndEmit = function () {
// Restart the playback if the sound was playing.
if (playing) {
self.play(id, true);
}
self._emit('seek', id);
} | Get/set the seek position of a sound. This method can optionally take 0, 1 or 2 arguments.
seek() -> Returns the first sound node's current seek position.
seek(id) -> Returns the sound id's current seek position.
seek(seek) -> Sets the seek position of the first sound node.
seek(seek, id) -> Sets the seek posit... | seekAndEmit | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
emitSeek = function () {
if (!self._playLock) {
seekAndEmit();
} else {
setTimeout(emitSeek, 0);
}
} | Get/set the seek position of a sound. This method can optionally take 0, 1 or 2 arguments.
seek() -> Returns the first sound node's current seek position.
seek(id) -> Returns the sound id's current seek position.
seek(seek) -> Sets the seek position of the first sound node.
seek(seek, id) -> Sets the seek posit... | emitSeek | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
Sound = function (howl) {
this._parent = howl;
this.init();
} | Setup the sound object, which each node attached to a Howl group is contained in.
@param {Object} howl The Howl parent group. | Sound | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
loadBuffer = function (self) {
var url = self._src;
// Check if the buffer has already been cached and use it instead.
if (cache[url]) {
// Set the duration from the cache.
self._duration = cache[url].duration;
// Load the sound into this Howl.
loadSound(self);
return;
}... | Buffer a sound from URL, Data URI or cache and decode to audio source (Web Audio API).
@param {Howl} self | loadBuffer | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
safeXhrSend = function (xhr) {
try {
xhr.send();
} catch (e) {
xhr.onerror();
}
} | Send the XHR request wrapped in a try/catch.
@param {Object} xhr XHR to send. | safeXhrSend | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
decodeAudioData = function (arraybuffer, self) {
// Fire a load error if something broke.
var error = function () {
self._emit('loaderror', null, 'Decoding audio data failed.');
};
// Load the sound on success.
var success = function (buffer) {
if (buffer && self._sounds.length > 0) {
... | Decode audio data from an array buffer.
@param {ArrayBuffer} arraybuffer The audio data.
@param {Howl} self | decodeAudioData | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
error = function () {
self._emit('loaderror', null, 'Decoding audio data failed.');
} | Decode audio data from an array buffer.
@param {ArrayBuffer} arraybuffer The audio data.
@param {Howl} self | error | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
success = function (buffer) {
if (buffer && self._sounds.length > 0) {
cache[self._src] = buffer;
loadSound(self, buffer);
} else {
error();
}
} | Decode audio data from an array buffer.
@param {ArrayBuffer} arraybuffer The audio data.
@param {Howl} self | success | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
loadSound = function (self, buffer) {
// Set the duration.
if (buffer && !self._duration) {
self._duration = buffer.duration;
}
// Setup a sprite if none is defined.
if (Object.keys(self._sprite).length === 0) {
self._sprite = { __default: [0, self._duration * 1000] };
}
// Fir... | Sound is now loaded, so finish setting everything up and fire the loaded event.
@param {Howl} self
@param {Object} buffer The decoded buffer sound source. | loadSound | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
setupAudioContext = function () {
// If we have already detected that Web Audio isn't supported, don't run this step again.
if (!Howler.usingWebAudio) {
return;
}
// Check if we are using Web Audio and setup the AudioContext if we are.
try {
if (typeof AudioContext !== 'undefined') {
... | Setup the audio context when available, or switch to HTML5 Audio mode. | setupAudioContext | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
setupPanner = function (sound, type) {
type = type || 'spatial';
// Create the new panner node.
if (type === 'spatial') {
sound._panner = Howler.ctx.createPanner();
sound._panner.coneInnerAngle = sound._pannerAttr.coneInnerAngle;
sound._panner.coneOuterAngle = sound._pannerAttr.coneOuterA... | Create a new panner node and save it on the sound.
@param {Sound} sound Specific sound to setup panning on.
@param {String} type Type of panner to create: 'stereo' or 'spatial'. | setupPanner | javascript | listen1/listen1_chrome_extension | js/vendor/howler.core.min.js | https://github.com/listen1/listen1_chrome_extension/blob/master/js/vendor/howler.core.min.js | MIT |
function uBlockOrigin_add() {
js_adsRemove(uBlockOrigin.chn0abortcurrentscript);
js_adsRemove(uBlockOrigin.chn0setconstant);
js_adsRemove(uBlockOrigin.abortcurrentscript);
js_adsRemove(uBlockOrigin.abortcurrentscript);
js_adsRemove(uBlockOrigin.abortcurrentscript);
js_adsRemove(uBlockOrigin.abor... | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | uBlockOrigin_add | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function adblock4limbo_svg_switch_by_width() {
//const userAgent = navigator.userAgent.toLowerCase();
const window_innerWidth = window.innerWidth;
if (window_innerWidth <= 920) {
//if (/\b(android|iphone|ipad|ipod)\b/i.test(userAgent)) {
var size = '54px';
return size;
} else {
... | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | adblock4limbo_svg_switch_by_width | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function pornhub_interstitialPass() {
const ele_skip = "[onclick*='clearModalCookie']"
const exist = document.querySelectorAll(ele_skip);
if (document.querySelectorAll(ele_skip).length > 0) {
const href = exist[1].href;
window.location = href;
}
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | pornhub_interstitialPass | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function _18comic_adsRemove() {
document.cookie = "cover=1";
document.cookie = "shunt=1";
document.cookie = "guide=1";
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | _18comic_adsRemove | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function missAv_adsRemove() {
document.cookie = "_gat_UA-177787578-7; expires=Thu, 01 Jan 1970 00:00:00 GMT";
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | missAv_adsRemove | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function set_cookie(name, value) {
document.cookie = name + '=' + value + '; Path=/;';
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | set_cookie | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function selector_adsRemove(selector, time) {
var i;
setTimeout(() => {
var nodelists = document.querySelectorAll(selector)
for (i = 0; i < nodelists.length; i++) {
//nodelists[i].remove();
nodelists[i].style = "display: none !important;"
}
}, time)
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | selector_adsRemove | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function tag_adsRemove(tagname, keyword) {
var i;
var tag = document.getElementsByTagName(tagname);
for (i = 0; i < tag.length; i++) {
if (tag[i].src.indexOf(keyword) !== -1) {
tag[i].remove()
}
if (tag[i].innerHTML.indexOf(keyword) !== -1) {
tag[i].remove()
... | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | tag_adsRemove | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function cloudflare_captchaBypass() {
var title = document.title;
if (title.search("Cloudflare") !== -1 || title.search("Attention") !== -1) {
window.location.reload();
console.log("captchaBypass done;")
};
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | cloudflare_captchaBypass | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function div_ad_missav() {
let div_ad = document.querySelectorAll('div.mx-auto[style]')
for (i = 0; i < div_ad.length; i++) {
if (div_ad[i].querySelectorAll('[target=\'_blank\']').length >= 1) {
div_ad[i].style.height = '0px'
}
}
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | div_ad_missav | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function video_loopPlay(x) {
if (x === 'loop') {
intval = window.setInterval(missAv_playbutton, 1000)
} else if (x === 'pause') {
if (intval) {
timerlist.forEach((item, index) => {
clearInterval(item);
})
video_pause();
}
}
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | video_loopPlay | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function fullscreen() {
const fullScreen = document.querySelector('button[data-plyr=\'fullscreen\']');
fullScreen.click()
//fullScreen.requestFullscreen();
//const fullScreen = document.querySelector('div.plyr__video-wrapper');
//fullScreen.requestFullscreen();
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | fullscreen | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
function addListener(selector, funx) {
setTimeout(() => {
var ele = document.querySelectorAll(selector);
for (let index = 0; index < ele.length; index++) {
ele[index].addEventListener("click", funx, false)
}
}, 1000)
} | ---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
--------------------------- | addListener | javascript | limbopro/Adblock4limbo | Adguard/Adblock4limbo.user.10.15.2023.js | https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.