I am converting a very basic WebExtension to a Safari Extension, and am getting an odd warning when I run the xcrun command.
xcrun safari-web-extension-converter
Warning: The following keys in your manifest.json are not supported by your current version of Safari. If these are critical to your extension, you should review your code to see if you need to make changes to support Safari:
manifest_version
js
name
matches
version
{
"name": "Search Engine Detector",
"version": "1.0.0",
"manifest_version": 2,
"permissions": [ "*://*/*" ],
"content_scripts": [ {
"js": [ "js/Bing.js" ],
"matches": [ "*://*.bing.com/*" ]
}, {
"js": [ "js/DuckDuckGo.js" ],
"matches": [ "*://*.duckduckgo.com/*" ]
}, {
"js": [ "js/Google.js" ],
"matches": [ "*://*.google.com/*" ]
}, {
"js": [ "js/Yahoo.js" ],
"matches": [ "*://*.yahoo.com/*" ]
} ]
}
The extension works as intended when built.
Why is the command line tool giving me incorrect information?
Related
How are you? I'm trying to migrate the version of extension from 2 to 3. For now, I want to get the result of build with version 3 so that I can upload it to the store. This is main reason why I'm migrating the extension.
It would be greatly appreciated if anyone give detailed solutions to be matched with my project? Looking forward to hearing from you.
This is origin manifest file. If you need more detail, I will provide.
{
"manifest_version": 2,
"version": "0.9.9",
"name": "AAAAAA",
"description": "BBBBBB",
"homepage_url": "https://AAA.co",
"permissions": [
"notifications",
"storage",
"activeTab",
"unlimitedStorage"
],
"icons": {
"16": "icons/icon.png",
"48": "icons/icon.png",
"128": "icons/icon.png",
"256": "icons/icon.png",
"512": "icons/icon.png",
"1024": "icons/icon.png"
},
"background": {
"scripts": [
"js/background.js"
],
"persistent": true
},
"content_scripts": [
{
"matches": [
"file://*/*",
"http://*/*",
"https://*/*"
],
"js": [
"js/content-script.js"
],
"run_at": "document_start",
"all_frames": false
}
],
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icons/icon.png",
"48": "icons/icon.png",
"128": "icons/icon.png",
"256": "icons/icon.png",
"512": "icons/icon.png",
"1024": "icons/icon.png"
}
},
"content_security_policy": "script-src 'self' 'unsafe-eval' https://cdn.segment.com 'sha256-ZgDy59Dh4jH9g/vcPYFpoQ1wumB4IdPEOS1BJc08i+Y='; object-src 'self';"
}
I am trying to filter one array with another array using Ramda.
This is an array of edges for ELK algorithm. sources and targets are arrays but in this case, those arrays have always single value.
const edges = [
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#2789a940-15d1-4ff0-b2ef-9f6cde676c18",
"sources": [
"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"
],
"targets": [
"2789a940-15d1-4ff0-b2ef-9f6cde676c18"
]
},
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#7cf88eab-5da4-492b-839c-30916fa98fb9",
"sources": [
"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"
],
"targets": [
"7cf88eab-5da4-492b-839c-30916fa98fb9"
]
},
{
"id": "fefd95e0-11d0-44f6-9b48-ec2a0ea1b328#53a6d558-c97b-42df-af69-cf27912dd158",
"sources": [
"fefd95e0-11d0-44f6-9b48-ec2a0ea1b328"
],
"targets": [
"53a6d558-c97b-42df-af69-cf27912dd158"
]
}
]
This is an example of a second array that I would like to use to filter values from the first one - id corresponds to the value in sources and outgoingNodeId corresponds to the value in targets from the first array.
const selectedNodes = [
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada",
"outgoingNodeId": "2789a940-15d1-4ff0-b2ef-9f6cde676c18",
"groupId": "27",
"sectionId": "0e09e7dd-0f71-48a1-a843-36d8e85574b3"
},
{
"id": "fefd95e0-11d0-44f6-9b48-ec2a0ea1b328",
"outgoingNodeId": "53a6d558-c97b-42df-af69-cf27912dd158",
"groupId": "27",
"sectionId": "0e09e7dd-0f71-48a1-a843-36d8e85574b3"
}
]
In this case, result should look like this:
const result = [
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#2789a940-15d1-4ff0-b2ef-9f6cde676c18",
"sources": [
"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"
],
"targets": [
"2789a940-15d1-4ff0-b2ef-9f6cde676c18"
]
},
{
"id": "fefd95e0-11d0-44f6-9b48-ec2a0ea1b328#53a6d558-c97b-42df-af69-cf27912dd158",
"sources": [
"fefd95e0-11d0-44f6-9b48-ec2a0ea1b328"
],
"targets": [
"53a6d558-c97b-42df-af69-cf27912dd158"
]
}
]
I tried few things but to be honest I don't have anything worth showing here.
My last try was around:
R.pipe(
R.groupBy(R.prop('sources'))
)(edges)
And then filtering using R.filter(R.compose(R.flip(R.contains)(selectedNodesIds), R.prop('id')))
But I need to filter not only sources but also targets
Any help would be appreciated. Thank you
EDIT:
Another example for a different approach:
const edges = [
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#2789a940-15d1-4ff0-b2ef-9f6cde676c18",
"sources": [
"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"
],
"targets": [
"2789a940-15d1-4ff0-b2ef-9f6cde676c18"
]
},
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#7cf88eab-5da4-492b-839c-30916fa98fb9",
"sources": [
"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"
],
"targets": [
"7cf88eab-5da4-492b-839c-30916fa98fb9"
]
},
{
"id": "fefd95e0-11d0-44f6-9b48-ec2a0ea1b328#53a6d558-c97b-42df-af69-cf27912dd158",
"sources": [
"fefd95e0-11d0-44f6-9b48-ec2a0ea1b328"
],
"targets": [
"53a6d558-c97b-42df-af69-cf27912dd158"
]
},
...multipleObjectsHere
]
selectedNodes contains only one object:
const selectedNodes = [
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada",
"outgoingNodeId": "2789a940-15d1-4ff0-b2ef-9f6cde676c18",
"groupId": "27",
"sectionId": "0e09e7dd-0f71-48a1-a843-36d8e85574b3"
}
]
As a result, we get:
const result = [
{
"id": "47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#2789a940-15d1-4ff0-b2ef-9f6cde676c18",
"sources": [
"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"
],
"targets": [
"2789a940-15d1-4ff0-b2ef-9f6cde676c18"
]
},
{
"id": "fefd95e0-11d0-44f6-9b48-ec2a0ea1b328#53a6d558-c97b-42df-af69-cf27912dd158",
"sources": [
"fefd95e0-11d0-44f6-9b48-ec2a0ea1b328"
],
"targets": [
"53a6d558-c97b-42df-af69-cf27912dd158"
]
},
...multipleObjectsHere
]
To sum up, if something is not in selectedNodes we don't filter it out and leave it as a result
Use R.innerJoin to create an intersection between 2 arrays using a comparison function:
const { innerJoin, includes } = R
const fn = innerJoin(({ sources, targets }, { id, outgoingNodeId }) =>
includes(id, sources) && includes(outgoingNodeId, targets)
)
const edges = [{"id":"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#2789a940-15d1-4ff0-b2ef-9f6cde676c18","sources":["47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"],"targets":["2789a940-15d1-4ff0-b2ef-9f6cde676c18"]},{"id":"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#7cf88eab-5da4-492b-839c-30916fa98fb9","sources":["47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"],"targets":["7cf88eab-5da4-492b-839c-30916fa98fb9"]},{"id":"fefd95e0-11d0-44f6-9b48-ec2a0ea1b328#53a6d558-c97b-42df-af69-cf27912dd158","sources":["fefd95e0-11d0-44f6-9b48-ec2a0ea1b328"],"targets":["53a6d558-c97b-42df-af69-cf27912dd158"]}]
const selectedNodes = [{"id":"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada","outgoingNodeId":"2789a940-15d1-4ff0-b2ef-9f6cde676c18","groupId":"27","sectionId":"0e09e7dd-0f71-48a1-a843-36d8e85574b3"},{"id":"fefd95e0-11d0-44f6-9b48-ec2a0ea1b328","outgoingNodeId":"53a6d558-c97b-42df-af69-cf27912dd158","groupId":"27","sectionId":"0e09e7dd-0f71-48a1-a843-36d8e85574b3"}]
const result = fn(edges, selectedNodes)
console.log(result)
.as-console-wrapper { max-height: 100% !important; top: 0; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.28.0/ramda.min.js" integrity="sha512-t0vPcE8ynwIFovsylwUuLPIbdhDj6fav2prN9fEu/VYBupsmrmk9x43Hvnt+Mgn2h5YPSJOk7PMo9zIeGedD1A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
The other logic should be see if the id is included in sources. If it is also check the outgoingNodeId. If not, return true.
const { innerJoin, includes } = R
const fn = innerJoin(({ sources, targets }, { id, outgoingNodeId }) =>
!includes(id, sources) || includes(outgoingNodeId, targets)
)
const edges = [{"id":"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#2789a940-15d1-4ff0-b2ef-9f6cde676c18","sources":["47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"],"targets":["2789a940-15d1-4ff0-b2ef-9f6cde676c18"]},{"id":"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada#7cf88eab-5da4-492b-839c-30916fa98fb9","sources":["47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada"],"targets":["7cf88eab-5da4-492b-839c-30916fa98fb9"]},{"id":"fefd95e0-11d0-44f6-9b48-ec2a0ea1b328#53a6d558-c97b-42df-af69-cf27912dd158","sources":["fefd95e0-11d0-44f6-9b48-ec2a0ea1b328"],"targets":["53a6d558-c97b-42df-af69-cf27912dd158"]}]
const selectedNodes = [{"id":"47c0ffd2-6a2c-4e7f-9fd9-0e1207225ada","outgoingNodeId":"2789a940-15d1-4ff0-b2ef-9f6cde676c18","groupId":"27","sectionId":"0e09e7dd-0f71-48a1-a843-36d8e85574b3"}]
const result = fn(edges, selectedNodes)
console.log(result)
.as-console-wrapper { max-height: 100% !important; top: 0; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.28.0/ramda.min.js" integrity="sha512-t0vPcE8ynwIFovsylwUuLPIbdhDj6fav2prN9fEu/VYBupsmrmk9x43Hvnt+Mgn2h5YPSJOk7PMo9zIeGedD1A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
I am trying to make my WebExtension work with Safari.
Why do all content scripts get injected into every page regardless of what I set matches to in manifest.json?
{
"name": "Search Engine Detector",
"version": "1.0.0",
"manifest_version": 2,
"permissions": [ "*://*/*" ],
"content_scripts": [ {
"js": [ "js/Bing.js" ],
"matches": [ "*://*.bing.com/*" ]
}, {
"js": [ "js/DuckDuckGo.js" ],
"matches": [ "*://*.duckduckgo.com/*" ]
}, {
"js": [ "js/Google.js" ],
"matches": [ "*://*.google.com/*" ]
}, {
"js": [ "js/Yahoo.js" ],
"matches": [ "*://*.yahoo.com/*" ]
} ]
}
To clarify, this only happens if I click 'Always Allow on Every Website' on install, or set 'For other websites' to Allow. Everything works fine if the configuration looks like this:
I'm creating EMR cluster from Step Functions using below code,
"spinning_emr_cluster": {
"Type": "Task",
"Resource": "arn:aws:states:::elasticmapreduce:createCluster.sync",
"Parameters": {
"Name": "CombineFiles",
"VisibleToAllUsers": true,
"ReleaseLabel": "emr-5.29.0",
"Applications": [
{
"Name": "Spark"
}
],
"ServiceRole": "EMR_DefaultRole",
"JobFlowRole": "EMR_EC2_DefaultRole",
"LogUri": "s3://awsmssqltos3/emr_logs/",
"Instances": {
"KeepJobFlowAliveWhenNoSteps": true,
"InstanceFleets": [
{
"Name": "Master",
"InstanceFleetType": "MASTER",
"TargetOnDemandCapacity": 1,
"InstanceTypeConfigs": [
{
"InstanceType": "m1.large"
}
]
},
{
"Name": "Slave",
"InstanceFleetType": "CORE",
"TargetOnDemandCapacity": 1,
"InstanceTypeConfigs": [
{
"InstanceType": "m1.large"
}
]
}
]
}
},
"ResultPath": "$.CreateClusterResult",
"Next": "lambda"
I want to add bootstrap actions while creating the cluster from AWS Step Functions. I have tried searching online but could not find any syntax for that.
"BootstrapActions": [
{
"Name": "CustomBootStrapAction",
"ScriptBootstrapAction": {
"Path": "",
"Args": []
}
}
]
Please Add above code inside Parameters Block.
I have a master changelog set up that contains all of my changelogs, which looks something like this:
{
"databaseChangeLog": [
{
"include": [
{ "file": "changelog/4.0/insert-languages-4.0.0.json" },
{ "relativeToChangelogFile":"true"}
],
"include": [
{ "file": "changelog/4.0/Create-order-datetime-concat4.0.1.json"},
{ "relativeToChangelogFile":"true"}
]
}
]}
The problem is only the last changelog in the list actually runs. I would like all of them to run one after another instead of just the last one. I set "onFail" for all prerequisites to "CONTINUE" so even if it hits an error it should continue with the rest of the changelogs. Any help would be appreciated, thanks!
your syntax is incorrect: the element include has to be closed
{
"databaseChangeLog": [
{
"include": [
{
"file": "include/include1.json"
},
{
"relativeToChangelogFile": "true"
}
]
},
{
"include": [
{
"file": "include/include2.json"
},
{
"relativeToChangelogFile": "true"
}
]
}
]
}