Skip to content

Commit fbd192f

Browse files
committed
lmptm.ignoreDisableSync, --disable-extensions
1 parent 7e917d3 commit fbd192f

File tree

4 files changed

+36
-19
lines changed

4 files changed

+36
-19
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
All notable changes to the "LetMePlayTheMusic" extension will be documented in this file.
44

5-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
5+
Check [Keep a Changelog](http://keepachangelog.com) for recommendations on how to structure this file.
6+
7+
## [1.3.0] - February 2020
8+
### Added
9+
- Add [ignoreDisableSync](https://github.com/puppeteer/puppeteer/blob/0b1777e73cb1e83ece9e09b7b51d11b798def06f/lib/Launcher.js#L277) setting [#3](https://github.com/lanly-dev/VSCode-LMPTM/issues/3#issuecomment-572180371), [#5](https://github.com/lanly-dev/VSCode-LMPTM/issues/5)
10+
- Use [Adblocker](https://github.com/cliqz-oss/adblocker/tree/master/packages/adblocker-puppeteer) - New version breaks webpack build
11+
- Ignore [disable extension flag from puppeteer](https://github.com/puppeteer/puppeteer/blob/0b1777e73cb1e83ece9e09b7b51d11b798def06f/lib/Launcher.js#L270)
12+
- 11 files, 141.77KB, 1.42.0
613

714
## [1.2.0] - December 2019
815
### Added
@@ -14,7 +21,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1421
## [1.1.0] - October 2019
1522
### Added
1623
- Use [Adblocker](https://github.com/cliqz-oss/adblocker/tree/master/packages/adblocker-puppeteer)
17-
- Improve extension package size with [Webpack](https://webpack.js.org/) from 4.98MB (v1.0.0) to 226.1KB (v1.1.0)
24+
- Improve extension package size with [Webpack](https://webpack.js.org) from 4.98MB (v1.0.0) to 226.1KB (v1.1.0)
1825
- 11 files, 226.28KB, 1.39.0
1926

2027
## [1.0.0] - August 2019

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,25 @@ Required Chromium-based browser
2121

2222
## Extension Settings
2323

24-
* `lmptm.browserPath`: Specifies custom browser executable file path.
25-
* `lmptm.incognitoMode`: Specifies whether to launch browser in incognito/private mode.
26-
* `lmptm.userData`: Specifies if the extension could store browser's user data, if enabled, user data directory setting is required.
27-
* `lmptm.userDataDirectory`: Specifies [user data directory](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md), this will be ignored if **User Data** setting disabled.
24+
* `lmptm.browserPath`: Specify custom browser executable file path.
25+
* `lmptm.ignoreDisableSync`: Ignore --disable-sync, this option is specifically for [Brave](https://brave.com) browser.
26+
* `lmptm.incognitoMode`: Specify whether to launch browser in incognito/private mode.
27+
* `lmptm.userData`: Specify if the extension could store browser's user data, if enabled, user data directory setting is required.
28+
* `lmptm.userDataDirectory`: Specify [user data directory](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md), this will be ignored if **User Data** setting disabled.
2829

2930
## Known Issues
3031

31-
Errors may pop up (mostly happen in console) or functioning incorrectly if navigating too fast
32+
- Errors may pop up (mostly happen in console) or functioning incorrectly if navigating too fast
33+
- Does not work with Opera browser
3234

3335
## Release Notes
3436

37+
### 1.3.0
38+
- Remove adblocker
39+
- Enable adding extensions for browser
40+
- Add ignoreDisableSync setting option in order to able to launch [Brave](https://brave.com) browser
41+
- Switch tslint to eslint
42+
3543
### 1.2.0
3644
- Able to launch other Chromium-based browsers
3745
- Able to launch browser in Incognito/Private mode

package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"displayName": "Let Me Play The Music",
44
"description": "Control playback from the popular music sites",
55
"homepage": "https://github.com/lanly-dev/VSCode-LMPTM",
6-
"version": "1.2.0",
6+
"version": "1.3.0",
77
"publisher": "lanly-dev",
88
"engines": {
9-
"vscode": "^1.41.0"
9+
"vscode": "^1.42.0"
1010
},
1111
"extensionKind": [
1212
"ui"
@@ -39,21 +39,26 @@
3939
"lmptm.browserPath": {
4040
"type": "string",
4141
"default": null,
42-
"markdownDescription": "Specifies custom browser executable file path."
42+
"markdownDescription": "Specify custom browser executable file path."
43+
},
44+
"lmptm.ignoreDisableSync": {
45+
"type": "boolean",
46+
"default": false,
47+
"markdownDescription": "Ignore `-disable-sync`, this option is specifically for [Brave](https://brave.com) browser."
4348
},
4449
"lmptm.incognitoMode": {
4550
"type": "boolean",
4651
"default": true,
47-
"markdownDescription": "Specifies whether to launch browser in incognito/private mode."
52+
"markdownDescription": "Specify whether to launch browser in incognito/private mode."
4853
},
4954
"lmptm.userData": {
5055
"type": "boolean",
5156
"default": false,
52-
"markdownDescription": "Specifies if the extension could store browser's user data, if enabled, user data directory setting is required"
57+
"markdownDescription": "Specify if the extension could store browser's user data, if enabled, user data directory setting is required"
5358
},
5459
"lmptm.userDataDirectory": {
5560
"type": "string",
56-
"markdownDescription": "Specifies [user data directory](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md), this will be ignored if **User Data** setting disabled."
61+
"markdownDescription": "Specify [user data directory](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md), this will be ignored if **User Data** setting disabled."
5762
}
5863
}
5964
}
@@ -88,9 +93,7 @@
8893
"webpack-cli": "^3.3.10"
8994
},
9095
"dependencies": {
91-
"@cliqz/adblocker-puppeteer": "^1.5.0",
9296
"karma-chrome-launcher": "^3.1.0",
93-
"node-fetch": "^2.6.0",
9497
"puppeteer-core": "^2.1.1",
9598
"terser": "^4.6.3"
9699
},

src/browser.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { PuppeteerBlocker } from '@cliqz/adblocker-puppeteer'
2-
import fetch from 'node-fetch'
31
import * as fs from 'fs'
42
import * as path from 'path'
53
import * as puppeteer from 'puppeteer-core'
@@ -31,11 +29,13 @@ export class Browser {
3129
public static launch(buttons: Buttons, context: vscode.ExtensionContext) {
3230
if (!Browser.activeBrowser && !Browser.launched) {
3331
const args = ['--window-size=500,500']
32+
const iArgs = ['--disable-extensions'] // enable extension
3433
if (vscode.workspace.getConfiguration().get('lmptm.userData')) {
3534
const uddir = vscode.workspace.getConfiguration().get('lmptm.userDataDirectory')
3635
if (uddir) args.push(`--user-data-dir=${vscode.workspace.getConfiguration().get('lmptm.userDataDirectory')}`)
3736
else return vscode.window.showInformationMessage('Please specify the user data directory or disable user data setting!')
3837
}
38+
if (vscode.workspace.getConfiguration().get('lmptm.ignoreDisableSync')) iArgs.push('--disable-sync')
3939

4040
let cPath = vscode.workspace.getConfiguration().get('lmptm.browserPath')
4141
if (!cPath) cPath = WhichChrome.getPaths().Chrome || WhichChrome.getPaths().Chromium
@@ -48,7 +48,7 @@ export class Browser {
4848
headless: false,
4949
defaultViewport: null,
5050
args: args,
51-
ignoreDefaultArgs: ['--mute-audio', '--hide-scrollbars']
51+
ignoreDefaultArgs: iArgs
5252
}).then(async (browser: puppeteer.Browser) => {
5353
buttons.setStatusButtonText('Running $(browser)')
5454
Browser.cssPath = path.join(context.extensionPath, 'dist', 'scripts', 'style.css')
@@ -366,7 +366,6 @@ export class Browser {
366366
await this.setupPageWatcher(page)
367367

368368
page.on('load', async () => {
369-
PuppeteerBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker: PuppeteerBlocker) => blocker.enableBlockingInPage(page))
370369
if (this.musicBrandCheck(page.url()) === 'spotify') await this.checkSpotifyCSP(page)
371370
this.injectHtml(page)
372371
this.addScripts(page)

0 commit comments

Comments
 (0)