Adding custom logic to declarativeNetRequest - google-chrome-extension

I have logic that used webRequestBlocking, where I'd redirect the request, if the request param matched some dynamically changeable values stored in background script, i.e. if user is placing orders for items 1,2,3 and my background script says, dont allow messages to item 1, then I'd in that case redirect the webrequest, do a check that the requestBody doesnt have item 1 set.
I am trying to do the same in V3, but I can't find a way, given there isnt a way for me to call any of my own custom methods from background script, I thought I can maybe just update rules to match for the requestBody params, but I can't seem to find a way to do that even?
Is there anything that can be done here? Not sure why would they remove support for something so important?

Related

Creating an array from a get webhook response nested json

The current Zapier steps i have set up creates a GET request to an external service. that service replies with a list of data that is nested. My end step i need to do is make multiple PUT requests to another API with part of the URL being a value from the response from the GET. There is not a fixed number of id’s/times that it will need to PUT. 
Currently if i do it with just the GET then the next step is the PUT it puts all of the values of the ID i need to put at the end of the API url as just a comma separated list. I need them to make separate PUT requests for Each ID.
Any help would be greatly appreciated.
This shows the response to the GET request (Images shows only the first part. There will are more in the response)
This is the PUT request. It currently puts them as a comma separated list. which causes an error. each of the values needs to process as a separate PUT.
​
You may want to consider writing your own code step to format the nested data into an array of objects (JSON). You could then return the data to output and achieve the effect you're looking for, where the next Step runs a PUT request for each item in your output array.
Here are Zapier's notes on this strategy:
Setting the output to an array of objects will run the subsequent steps multiple times — once for each object in the array. If Code by Zapier is the Zap's trigger and an empty array is returned, nothing happens. You can think of it like a polling trigger that did not get any results in the HTTP response. This functionality is exclusive to triggers — returning an empty array in a Code by Zapier action does not have the same effect.

where is the docusign api tab label wildcard matching documentation

In the api you can select multiple fields with something like this:
Text text = new Text();
text.setTabLabel("\\*_broker");
This will apply settings to all textfields that have names that end with "_broker".
But i want to select ALL text fields in the entire document and "\\*" does not seem to work.
Can anyone tell me how to select all fields from the API, or even better point me to the documentation for the setTabLabel matching format.
I've look all over and it seems alot of the old documentation links no longer work.
Thanks.
You can assign assign all transformed form fields to the first recipient by making them the default recipient (set defaultRecipient to true).
In order to make all of those form fields Collaborative, I believe you'll need to make extra API calls:
First, create the envelope as a draft (status = created instead of sent).
Then make a call to get the list of all the tabs (EnvelopeRecipients::List with include_tabs=true)
Finally, Use the tabLabels (or IDs) in an Envelopes::Update call to add the "shared": "true" parameter to each of them, and update the status to sent to actually send it.

Generate a variable in Groovy JMeter

I have a Thread Group wherein I have three samplers. They are HTML Requests. The first one returns a person and gives me the name, age and address. The second one changes the attribute name of the person but has no response.
The third sampler is the same as the first.
The second sampler isn't working and doesn't change the name.
I want a failure message like: "The name of the person was $(name1) and should be changed to $(name2), but the name is $(name3)" or something like that.
I do the whole things with Groovy so is there any way to generate variables with the output of the first and third request and the input of the second?
Most probably you're looking for Response Assertion, you can conditionally mark samplers as failed depending on various criteria. It might be the case that you won't even need scripting like.
Just add Response Assertion as a child of 3rd request and configure it to expect ${name3} variable to be present in the response (you can use Perl-5 style regular expressions for this as well) and if the name will not be present - the sampler will get failed and you will see the relevant failure message
More information: How to Use JMeter Assertions in Three Easy Steps
I do not think you can do it the way you describe it, because samplers are processed sequentially, so you can not process first, third and go to second request. You might want to re-evaluate your approach.

Sitecore Search Api - How to get formatted Url

How can I get the formatted url from Sitecore Lucene search? I created a custom index and updated it with under root as /sitecore/content/websitename/home.
When the search results are retrieved the URL is appended with https://hostname/websitename/home/sample.aspx. I would like the url to be https://hostname/sample.aspx. Is there any setting in index config that needs to be updated?
In sites.config I already have rootPath="/sitecore/content/websitename" startItem="/home"
You can get the url in two ways:
For each result from your index, fetch the item and get the url with the LinkManager as you normally would for any item. This does mean that you need to fetch the items what will be a performance hit.
Create a computed field in your index to include the url. In your computed field, make sure the correct link is being generated. If not, you might need to check your url options and the maybe the Rendering.SiteResolving setting (true). Verify the results with a debugger (or with Luke to test the index). Remember that if you include the url in the index, you will need to update additional items when an item is renamed (or even the display name changed when that is used in the url). All children of that changed item had their urls changed as well at that point.

making dynamically generated menus in Pyramid

I'm trying to have my menus automatically change according to settings in my code so I don't have logic duplicated in my templates. Right now I use the route names to generate the urls with request.route_path(name) and determine what the current page the user is on with request.matched_route.name. My problem now is that I want to have different permissions on different views and automatically hide menu items that the user doesn't have permission to.
One of the major difficulties is that you can have multiple views for one route. But even if there's only one view associated with a route, I can't seem to find any simple way to retrieve it.
I'm using URL Dispatch. Is this something that'd only be do-able with traversal?
Normally I use a combination of the following patterns for this:
My views are organized into classed
The base class has a basic _menu which is a list of (menu_title, route_name, params) where params is an optionally present dict. When in the template I can use a menu property that builds the menu from the request and the above attribute.
In the template create a function that iterates over theses entries, shows each but checks with something like has_permission if the view is actually allowed.
These ideas should get you started on a dynamic solution. It works fine for me, but it might require some more tweaking, for example, I attach another value "active" to the generated menu based on the current route.

Resources