Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client: add silent property #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions client/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const __FORCED_SERVER_URL__ = "";
*
*/

function init(currentScriptSrc, playerClass) {
function init(currentScriptSrc, playerClass, silent) {
let wsUrl = _DEVICE_DEBUGGER_URL_;
if (__FORCED_SERVER_URL__ !== "") {
if (/^https?:\/\//i.test(__FORCED_SERVER_URL__)) {
Expand Down Expand Up @@ -120,7 +120,9 @@ function init(currentScriptSrc, playerClass) {
console[meth] = function (...args) {
const argStr = args.map(processArg).join(" ");
formatAndSendLog(meth, argStr);
return oldConsoleFn.apply(this, args);
if (!Boolean(silent)) {
return oldConsoleFn.apply(this, args);
}
};
return function () {
console[meth] = oldConsoleFn;
Expand Down Expand Up @@ -545,7 +547,7 @@ if (document.currentScript !== null) {
// `playerClass` property inside that function's unique object parameter.
//
// If the RxPlayer isn't imported yet, `playerClass` can be set to `null`.
window.__RX_INSPECTOR_RUN__ = function run({ url, playerClass }) {
init(url, playerClass);
window.__RX_INSPECTOR_RUN__ = function run({ url, playerClass, silent }) {
init(url, playerClass, silent);
};
}
Loading