This is a very simple userscript that disables AMP pages on the Google search results page. Open Google search results on a mobile phone, click on the link marked as AMP. This link should be opened without AMP.
- AdGuard for Android has this userscript pre-installed (disabled by default).
- You can use Violentmonkey, Tampermonkey, Greasemonkey or any other userscript host.
yarn install
Command | Output Dir |
---|---|
yarn dev |
build/dev |
yarn beta |
build/beta |
yarn release |
build/release |
Placeholder - string in format [PLACEHOLDER_NAME]
which will be replaced with metadata field.
Field or Metadata field - result string of metadata, e.g:
// @description:en Userscript description text
Remove, add or replace placeholders in file meta.template.js
.
To specify the data for placeholders change the meta.settings.js
.
// meta.settings.js file structure
const releaseChannels = {
common: options,
dev: options,
beta: options,
release: options,
};
common
- object with options which will be applied for all builds, you can redefine these options for specific release channel.
dev
, beta
, release
- contains options for corresponding builds.
options
filename
- the name of userscript metadata file, plugin creates new file in format [filename].meta.js
.
postfix
- string , default ''
, you can specify postfix for some fields (requires usePostfix:true
flag for fieldOptions
).
metadataTemplate
- default metadata.template.js
, relative path to template of metadata.
localesDir
- default ./locales
, relative path to directorty with locales.
fields
- the object, where key is the name of placeholder and value is a string or fieldOptions
object.
fieldOptions
If the data for field should be taken from translation, you need to use fieldOptions
const releaseChannels = {
...
dev: {
filename: 'userscript-boilerplate',
postfix: 'Dev',
localesDir: './_locales',
fields: {
URL: 'http:example.org',
// fieldOptions
USERSCRIPT_NAME: {
messageKey: 'some_name',
metaName: 'name',
usePostfix: true,
}
}
},
...
}
messageKey
- string, key in translation file for this field.
metaName
- string, name of field in output metadata file.
usePostfix
- boolean, default false
, use postfix for this field.
- add needed locales codes to
const LOCALES = ['en', 'ru'];
array - run
yarn locales:download
to download translations - run
yarn locales:upload
to update current tranlations in Crowdin
yarn test
- Add new file with tests in directory
./tests
- Add
import './path-to-your-file'
inindex.test.js
yarn lint
- Fix AMP on Google images