-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,133 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,8 @@ | |
"chrome": "49", | ||
"firefox": "52", | ||
"opera": "36", | ||
"edge": "79" | ||
"edge": "79", | ||
"safari": "14" | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @author abhijithvijayan <abhijithvijayan.in> | ||
* from https://github.com/abhijithvijayan/wext-manifest-loader/blob/wext-manifest/index.js | ||
*/ | ||
|
||
const transformVendorKeys = require('./transformVendorKeys'); | ||
|
||
exports.chrome = input => { | ||
const manifest = transformVendorKeys(input, 'chrome'); | ||
|
||
return { name: 'manifest.json', content: JSON.stringify(manifest, null, 2) }; | ||
}; | ||
|
||
exports.firefox = input => { | ||
const manifest = transformVendorKeys(input, 'firefox'); | ||
|
||
return { name: 'manifest.json', content: JSON.stringify(manifest, null, 2) }; | ||
}; | ||
|
||
exports.opera = input => { | ||
const manifest = transformVendorKeys(input, 'opera'); | ||
|
||
return { name: 'manifest.json', content: JSON.stringify(manifest, null, 2) }; | ||
}; | ||
|
||
exports.edge = input => { | ||
const manifest = transformVendorKeys(input, 'edge'); | ||
|
||
return { name: 'manifest.json', content: JSON.stringify(manifest, null, 2) }; | ||
}; | ||
|
||
exports.safari = input => { | ||
const manifest = transformVendorKeys(input, 'safari'); | ||
|
||
return { name: 'manifest.json', content: JSON.stringify(manifest, null, 2) }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const browserVendors = ['chrome', 'firefox', 'opera', 'edge', 'safari']; | ||
const vendorRegExp = new RegExp(`^__((?:(?:${browserVendors.join('|')})\\|?)+)__(.*)`); | ||
|
||
/** | ||
* Fork of `webextension-toolbox/webpack-webextension-plugin` | ||
*/ | ||
const transformVendorKeys = (manifest, vendor) => { | ||
if (Array.isArray(manifest)) { | ||
return manifest.map(newManifest => { | ||
return transformVendorKeys(newManifest, vendor); | ||
}); | ||
} | ||
|
||
if (typeof manifest === 'object') { | ||
return Object.entries(manifest).reduce((newManifest, [key, value]) => { | ||
const match = key.match(vendorRegExp); | ||
|
||
if (match) { | ||
const vendors = match[1].split('|'); | ||
|
||
// Swap key with non prefixed name | ||
if (vendors.indexOf(vendor) > -1) { | ||
newManifest[match[2]] = value; | ||
} | ||
} else { | ||
newManifest[key] = transformVendorKeys(value, vendor); | ||
} | ||
|
||
return newManifest; | ||
}, {}); | ||
} | ||
|
||
return manifest; | ||
}; | ||
module.exports = transformVendorKeys; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable */ | ||
if (typeof browser === 'undefined' || Object.getPrototypeOf(browser) !== Object.prototype) { | ||
module.exports = require('webextension-polyfill-origin'); | ||
} else { | ||
module.exports = browser; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See LICENSE folder for this sample’s licensing information. | ||
# | ||
# Apple sample code gitignore configuration. | ||
|
||
# Finder | ||
.DS_Store | ||
|
||
# Xcode - User files | ||
xcuserdata/ | ||
|
||
**/*.xcodeproj/project.xcworkspace/* | ||
!**/*.xcodeproj/project.xcworkspace/xcshareddata | ||
|
||
**/*.xcodeproj/project.xcworkspace/xcshareddata/* | ||
!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | ||
|
||
**/*.playground/playground.xcworkspace/* | ||
!**/*.playground/playground.xcworkspace/xcshareddata | ||
|
||
**/*.playground/playground.xcworkspace/xcshareddata/* | ||
!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings |
10 changes: 10 additions & 0 deletions
10
xProject/Git Master Extension/Git_Master_Extension.entitlements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
<key>com.apple.security.files.user-selected.read-only</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>Git Master Extension</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.Safari.web-extension</string> | ||
<key>NSExtensionPrincipalClass</key> | ||
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string> | ||
</dict> | ||
</dict> | ||
</plist> |
Oops, something went wrong.