From 37609bdb1c1c43e40b3ecf50cb80f73c6ce0d32c Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sat, 24 Apr 2021 18:22:15 -0700 Subject: [PATCH 01/11] Add files via upload From 56cc67af36ba196267e8ec09ca9d6bf3a22ad99f Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sat, 1 May 2021 14:20:51 -0700 Subject: [PATCH 02/11] Delete Audio Filtering --- Audio Filtering | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Audio Filtering diff --git a/Audio Filtering b/Audio Filtering deleted file mode 100644 index cf499f0..0000000 --- a/Audio Filtering +++ /dev/null @@ -1 +0,0 @@ -Mute God word From 1908628212ca6a7eda197a2d69b06949466e9eca Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sat, 1 May 2021 14:21:05 -0700 Subject: [PATCH 03/11] Delete Random Scriptable API.js --- Random Scriptable API.js | 103 --------------------------------------- 1 file changed, 103 deletions(-) delete mode 100644 Random Scriptable API.js diff --git a/Random Scriptable API.js b/Random Scriptable API.js deleted file mode 100644 index acbc381..0000000 --- a/Random Scriptable API.js +++ /dev/null @@ -1,103 +0,0 @@ -// Variables used by Scriptable. -// These must be at the very top of the file. Do not edit. -// icon-color: deep-blue; icon-glyph: book; -// This script shows a random Scriptable API in a widget. The script is meant to be used with a widget configured on the Home Screen. -// You can run the script in the app to preview the widget or you can go to the Home Screen, add a new Scriptable widget and configure the widget to run this script. -// You can also try creating a shortcut that runs this script. Running the shortcut will show widget. -let api = await randomAPI() -let widget = await createWidget(api) -if (config.runsInWidget) { - // The script runs inside a widget, so we pass our instance of ListWidget to be shown inside the widget on the Home Screen. - Script.setWidget(widget) -} else { - // The script runs inside the app, so we preview the widget. - widget.presentMedium() -} -// Calling Script.complete() signals to Scriptable that the script have finished running. -// This can speed up the execution, in particular when running the script from Shortcuts or using Siri. -Script.complete() - -async function createWidget(api) { - let appIcon = await loadAppIcon() - let title = "Random Scriptable API" - let widget = new ListWidget() - // Add background gradient - let gradient = new LinearGradient() - gradient.locations = [0, 1] - gradient.colors = [ - new Color("141414"), - new Color("13233F") - ] - widget.backgroundGradient = gradient - // Show app icon and title - let titleStack = widget.addStack() - let appIconElement = titleStack.addImage(appIcon) - appIconElement.imageSize = new Size(15, 15) - appIconElement.cornerRadius = 4 - titleStack.addSpacer(4) - let titleElement = titleStack.addText(title) - titleElement.textColor = Color.white() - titleElement.textOpacity = 0.7 - titleElement.font = Font.mediumSystemFont(13) - widget.addSpacer(12) - // Show API - let nameElement = widget.addText(api.name) - nameElement.textColor = Color.white() - nameElement.font = Font.boldSystemFont(18) - widget.addSpacer(2) - let descriptionElement = widget.addText(api.description) - descriptionElement.minimumScaleFactor = 0.5 - descriptionElement.textColor = Color.white() - descriptionElement.font = Font.systemFont(18) - // UI presented in Siri ans Shortcuta is non-interactive, so we only show the footer when not running the script from Siri. - if (!config.runsWithSiri) { - widget.addSpacer(8) - // Add button to open documentation - let linkSymbol = SFSymbol.named("arrow.up.forward") - let footerStack = widget.addStack() - let linkStack = footerStack.addStack() - linkStack.centerAlignContent() - linkStack.url = api.url - let linkElement = linkStack.addText("Read more") - linkElement.font = Font.mediumSystemFont(13) - linkElement.textColor = Color.blue() - linkStack.addSpacer(3) - let linkSymbolElement = linkStack.addImage(linkSymbol.image) - linkSymbolElement.imageSize = new Size(11, 11) - linkSymbolElement.tintColor = Color.blue() - footerStack.addSpacer() - // Add link to documentation - let docsSymbol = SFSymbol.named("book") - let docsElement = footerStack.addImage(docsSymbol.image) - docsElement.imageSize = new Size(20, 20) - docsElement.tintColor = Color.white() - docsElement.imageOpacity = 0.5 - docsElement.url = "https://docs.scriptable.app" - } - return widget -} - -async function randomAPI() { - let docs = await loadDocs() - let apiNames = Object.keys(docs) - let num = Math.round(Math.random() * apiNames.length) - let apiName = apiNames[num] - let api = docs[apiName] - return { - name: apiName, - description: api["!doc"], - url: api["!url"] - } -} - -async function loadDocs() { - let url = "https://docs.scriptable.app/scriptable.json" - let req = new Request(url) - return await req.loadJSON() -} - -async function loadAppIcon() { - let url = "https://is5-ssl.mzstatic.com/image/thumb/Purple124/v4/21/1e/13/211e13de-2e74-4221-f7db-d6d2c53b4323/AppIcon-1x_U007emarketing-0-7-0-85-220.png/540x540sr.jpg" - let req = new Request(url) - return req.loadImage() -} \ No newline at end of file From 7dc410aebb9daf1f0f1df6479a05ee0d6b5137b0 Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sat, 1 May 2021 14:21:19 -0700 Subject: [PATCH 04/11] Delete SRT --- SRT | 1 - 1 file changed, 1 deletion(-) delete mode 100644 SRT diff --git a/SRT b/SRT deleted file mode 100644 index 8b13789..0000000 --- a/SRT +++ /dev/null @@ -1 +0,0 @@ - From 8197d9f78852ac02021b30c363f216001e27ec48 Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sat, 1 May 2021 14:21:37 -0700 Subject: [PATCH 05/11] Delete TravisLibby1 --- TravisLibby1 | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 TravisLibby1 diff --git a/TravisLibby1 b/TravisLibby1 deleted file mode 100644 index f84f5fb..0000000 --- a/TravisLibby1 +++ /dev/null @@ -1,11 +0,0 @@ -text eol=lf - -*.jpg binary -*.mp3 binary -*.png binary - -# https://github.com/github/linguist#overrides -/src/static/w3.css linguist-vendored -/src/static/w3-color-flat.css linguist-vendored -/store/* linguist-vendored -/test/* linguist-documentation From f198046147a7ad404e0e8f9b363d69a4e10c1523 Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Wed, 19 May 2021 14:29:09 -0700 Subject: [PATCH 06/11] Delete README.md --- README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 8b13789..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ - From 7c275ed706cfc7610ed0a5fb60bc9d1c3e0bd8ab Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sun, 23 May 2021 15:42:20 -0700 Subject: [PATCH 07/11] Delete Travis Libby --- Travis Libby | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Travis Libby diff --git a/Travis Libby b/Travis Libby deleted file mode 100644 index 61eef3e..0000000 --- a/Travis Libby +++ /dev/null @@ -1,7 +0,0 @@ -import Constants from './lib/constants'; -import WebFilter from './webFilter'; -import BookmarkletFilter from './bookmarkletFilter'; -import WebAudioSites from './webAudioSites'; -import { getGlobalVariable, hmsToSeconds, makeRequest, secondsToHMS } from './lib/helper'; -import Logger from './lib/logger'; -const logger = new Logger(); From ee01292a56ce0096c7d2383ee4fb392fc7ce8dcc Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sun, 23 May 2021 15:42:33 -0700 Subject: [PATCH 08/11] Delete .gitignore --- .gitignore | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a01e7fc..0000000 --- a/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -*.class - -# Package Files # -*.jar -*.war - -# gwt caches and compiled units # -war/gwt_bree/ -gwt-unitCache/ - -# boilerplate generated classes # -.apt_generated/ - -# more caches and things from deploy # -war/WEB-INF/deploy/ -war/WEB-INF/classes/ - -#compilation logs -.gwt/ - -#gwt junit compilation files -www-test/ - -#old GWT (1.5) created this dir -.gwt-tmp/ From c28f06aea7e22c1a55885d412fa4e5ec98933716 Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sun, 23 May 2021 15:42:52 -0700 Subject: [PATCH 09/11] Delete LICENSE --- LICENSE | 201 -------------------------------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. From daa90071e75da7b9cae8cfd090ae53f7024a67a6 Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sun, 23 May 2021 15:43:01 -0700 Subject: [PATCH 10/11] Delete Tr --- Tr | 297 ------------------------------------------------------------- 1 file changed, 297 deletions(-) delete mode 100644 Tr diff --git a/Tr b/Tr deleted file mode 100644 index 32e0df7..0000000 --- a/Tr +++ /dev/null @@ -1,297 +0,0 @@ -import Constants from './lib/constants'; -import Domain from './domain'; -import Filter from './lib/filter'; -import Page from './page'; -import WebAudio from './webAudio'; -import WebConfig from './webConfig'; -import Wordlist from './lib/wordlist'; -import './vendor/findAndReplaceDOMText'; - -// NO-OP for chrome.* API -const chrome = {} as any; -chrome.runtime = {}; -chrome.runtime.sendMessage = (obj) => {}; - -/* @preserve - Start User Config */ -const config = WebConfig._defaults as any; -config.words = WebConfig._defaultWords; -/* @preserve - End User Config */ - -export default class BookmarkletFilter extends Filter { - audio: WebAudio; - audioOnly: boolean; - audioWordlistId: number; - cfg: WebConfig; - domain: Domain; - extension: boolean; - hostname: string; - iframe: Location; - location: Location | URL; - mutePage: boolean; - observer: MutationObserver; - processMutationTarget: boolean; - processNode: (node: HTMLElement | Document | ShadowRoot, wordlistId: number, stats?: boolean) => void; - shadowObserver: MutationObserver; - - constructor() { - super(); - this.extension = false; - this.audioWordlistId = 0; - this.mutePage = false; - this.processMutationTarget = false; - } - - advancedReplaceText(node, wordlistId: number, stats = true) { - if (node.parentNode || node === document) { - this.wordlists[wordlistId].regExps.forEach((regExp) => { - // @ts-ignore: External library function - findAndReplaceDOMText(node, { preset: 'prose', find: regExp, replace: (portion, match) => { - if (portion.index === 0) { - return this.replaceText(match[0], wordlistId, stats); - } else { - return ''; - } - } }); - }); - } else { - this.cleanText(node, wordlistId, stats); - } - } - - checkMutationForProfanity(mutation) { - mutation.addedNodes.forEach((node) => { - if (!Page.isForbiddenNode(node)) { - if (this.mutePage) { - this.cleanAudio(node); - } else if (!this.audioOnly) { - this.processNode(node, this.wordlistId); - } - } - }); - - if (this.mutePage && this.audio.muted) { - mutation.removedNodes.forEach((node) => { - const supported = this.audio.supportedNode(node); - const rule = supported !== false ? this.audio.rules[supported] : this.audio.rules[0]; - if ( - supported !== false - || node == this.audio.lastFilteredNode - || node.contains(this.audio.lastFilteredNode) - || ( - rule.simpleUnmute - && this.audio.lastFilteredText - && this.audio.lastFilteredText.includes(node.textContent) - ) - ) { - this.audio.unmute(rule); - } - }); - } - - if (mutation.target) { - if (mutation.target.nodeName === '#text') { - this.checkMutationTargetTextForProfanity(mutation); - } else if (this.processMutationTarget) { - this.processNode(mutation.target, this.wordlistId); - } - } - } - - checkMutationTargetTextForProfanity(mutation) { - if (!Page.isForbiddenNode(mutation.target)) { - if (this.mutePage) { - const supported = this.audio.supportedNode(mutation.target); - const rule = supported !== false ? this.audio.rules[supported] : this.audio.rules[0]; - if (supported !== false && rule.simpleUnmute) { - // Supported node. Check if a previously filtered node is being removed - if ( - this.audio.muted - && mutation.oldValue - && this.audio.lastFilteredText - && this.audio.lastFilteredText.includes(mutation.oldValue) - ) { - this.audio.unmute(rule); - } - this.audio.clean(mutation.target, supported); - } else if (rule.simpleUnmute && this.audio.muted && !mutation.target.parentElement) { - // Check for removing a filtered subtitle (no parent) - if (this.audio.lastFilteredText && this.audio.lastFilteredText.includes(mutation.target.textContent)) { - this.audio.unmute(rule); - } - } else if (!this.audioOnly) { // Filter regular text - const result = this.replaceTextResult(mutation.target.data, this.wordlistId); - if (result.modified) { mutation.target.data = result.filtered; } - } - } else if (!this.audioOnly) { // Filter regular text - const result = this.replaceTextResult(mutation.target.data, this.wordlistId); - if (result.modified) { mutation.target.data = result.filtered; } - } - } - } - - cleanAudio(node) { - if (this.audio.youTube && this.audio.youTubeAutoSubsPresent()) { - if (this.audio.youTubeAutoSubsSupportedNode(node)) { - if (this.audio.youTubeAutoSubsCurrentRow(node)) { - this.audio.cleanYouTubeAutoSubs(node); - } else if (!this.audioOnly) { - this.processNode(node, this.wordlistId); - } - } else if (!this.audioOnly && !this.audio.youTubeAutoSubsNodeIsSubtitleText(node)) { - this.processNode(node, this.wordlistId); - } - } else { - const supported = this.audio.supportedNode(node); - if (supported !== false) { - this.audio.clean(node, supported); - } else if (!this.audioOnly) { - this.processNode(node, this.wordlistId); - } - } - } - - cleanChildNode(node, wordlistId: number, stats: boolean = true) { - if (node.nodeName) { - if (node.textContent && node.textContent.trim() != '') { - const result = this.replaceTextResult(node.textContent, wordlistId, stats); - if (result.modified) { - node.textContent = result.filtered; - } - } else if (node.nodeName == 'IMG') { - if (node.alt != '') { node.alt = this.replaceText(node.alt, wordlistId, stats); } - if (node.title != '') { node.title = this.replaceText(node.title, wordlistId, stats); } - } else if (node.shadowRoot) { - this.filterShadowRoot(node.shadowRoot, wordlistId, stats); - } - } - } - - cleanNode(node, wordlistId: number, stats: boolean = true) { - if (Page.isForbiddenNode(node)) { return false; } - if (node.shadowRoot) { this.filterShadowRoot(node.shadowRoot, wordlistId, stats); } - if (node.childNodes.length > 0) { - for (let i = 0; i < node.childNodes.length ; i++) { - this.cleanNode(node.childNodes[i], wordlistId, stats); - } - } else { - this.cleanChildNode(node, this.wordlistId, stats); - } - } - - cleanPage() { - this.cfg = new WebConfig(config); - this.domain = Domain.byHostname(this.hostname, this.cfg.domains); - this.cfg.muteMethod = Constants.MuteMethods.Video; // Bookmarklet: Force video volume mute method - - // Use domain-specific settings - const message: Message = { disabled: (this.cfg.enabledDomainsOnly && !this.domain.enabled) || this.domain.disabled }; - if (message.disabled) { - chrome.runtime.sendMessage(message); - return false; - } - if (this.domain.wordlistId !== undefined) { this.wordlistId = this.domain.wordlistId; } - if (this.domain.audioWordlistId !== undefined) { this.audioWordlistId = this.domain.audioWordlistId; } - - // Detect if we should mute audio for the current page - if (this.cfg.muteAudio) { - this.audio = new WebAudio(this); - this.mutePage = this.audio.supportedPage; - if (this.mutePage) { - if (this.cfg.wordlistsEnabled && this.wordlistId != this.audio.wordlistId) { - this.wordlists[this.audio.wordlistId] = new Wordlist(this.cfg, this.audio.wordlistId); - } - } - } - - // Remove profanity from the main document and watch for new nodes - this.init(); - if (!this.audioOnly) { this.processNode(document, this.wordlistId); } - this.startObserving(document); - } - - cleanText(node, wordlistId: number, stats: boolean = true) { - if (Page.isForbiddenNode(node)) { return false; } - if (node.shadowRoot) { this.filterShadowRoot(node.shadowRoot, wordlistId, stats); } - if (node.childElementCount > 0) { - const treeWalker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT); - while(treeWalker.nextNode()) { - if (treeWalker.currentNode.childNodes.length > 0) { - treeWalker.currentNode.childNodes.forEach((childNode) => { - this.cleanText(childNode, wordlistId, stats); - }); - } else { - if (!Page.isForbiddenNode(treeWalker.currentNode)) { - this.cleanChildNode(treeWalker.currentNode, wordlistId, stats); - } - } - } - } else { - this.cleanChildNode(node, wordlistId, stats); - } - } - - filterShadowRoot(shadowRoot: ShadowRoot, wordlistId: number, stats: boolean = true) { - this.shadowObserver.observe(shadowRoot, ObserverConfig); - this.processNode(shadowRoot, wordlistId, stats); - } - - init(wordlistId: number | false = false) { - super.init(wordlistId); - - if (this.domain.advanced) { - this.processNode = this.advancedReplaceText; - } else if (this.domain.deep) { - this.processMutationTarget = true; - this.processNode = this.cleanNode; - } else { - this.processNode = this.cleanText; - } - } - - processMutations(mutations) { - mutations.forEach((mutation) => { - filter.checkMutationForProfanity(mutation); - }); - } - - startObserving(target: Node = document, observer: MutationObserver = this.observer) { - observer.observe(target, ObserverConfig); - } - - stopObserving(observer: MutationObserver = this.observer) { - const mutations = observer.takeRecords(); - observer.disconnect(); - if (mutations) { this.processMutations(mutations); } - } - - updateCounterBadge() {} // NO-OP -} - -const filter = new BookmarkletFilter; -const ObserverConfig: MutationObserverInit = { - characterData: true, - characterDataOldValue: true, - childList: true, - subtree: true, -}; - -if (typeof window !== 'undefined') { - filter.observer = new MutationObserver(filter.processMutations); - filter.shadowObserver = new MutationObserver(filter.processMutations); - - if (window != window.top) { - filter.iframe = document.location; - try { - filter.hostname = window.parent.location.hostname; - } catch(e) { - if (document.referrer) { - filter.hostname = new URL(document.referrer).hostname; - } else { - filter.hostname = document.location.hostname; - } - } - } else { - filter.hostname = document.location.hostname; - } - - filter.cleanPager(); From 3d7590d0f92134a69188aa1bdf5856d0e25fad01 Mon Sep 17 00:00:00 2001 From: travislibby0000 <82604516+travislibby0000@users.noreply.github.com> Date: Sun, 23 May 2021 16:02:16 -0700 Subject: [PATCH 11/11] Delete .github/workflows directory --- .github/workflows/blank.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml deleted file mode 100644 index e192747..0000000 --- a/.github/workflows/blank.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the Profanity-filtering branch - push: - branches: [ Profanity-filtering ] - pull_request: - branches: [ Profanity-filtering ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project.