Fiddler extension development: only operate on requests from composer - fiddler

I'm trying to create a fiddler (v4.x) extension that builds and adds a custom header to requests generated by the composer. I started down the road of creating an IAutoTamper implementation that adds the header on the AutoTamperRequestBefore event. I quickly realized that this event fires for every request that passes through the fiddler proxy, not just for requests generated from the composer.
Is there any way to detect if a request was generated by the composer? Alternatively, is there a better extension point to handle this in other than through an AutoTamper?

If you right-click on a session in the Web Sessions list, you can choose Properties to see all of the Session Flags set on that session. You'll notice that all requests from the composer have a flag named X-From-Builder.
So, in your extension's code, you can simply write:
// Inside AutoTamperRequestAfter
if (oSession.oFlags.ContainsKey("X-From-Builder")) {
// Whatever...
}

Related

Attachments are not updated asynchronously in Fiori MyInbox app?

I use SAP standard library: Inbox.
in library class S3.controller by tap on attachments icon is onTabSelect event executed, witch makes
this.fnDelegateAttachmentsCreation();
this.fnFetchDataOnTabSelect("Attachments");
this.fnHandleAttachmentsCountText("Attachments");
this.fnHandleNoTextCreation("Attachments");
break;
fnFetchDataOnTabSelect makes an asynchronous call. During this call is fnHandleAttachmentsCountText already executed, so the update of attachments count occurs before the request for attachments is ready. As far the request for attachments is ready, there is no update for title executed.
On screenshot is AttachmentCountText „Attachnents (1/1)“, that comes from previously selected item.
It should be „Attachements (2/2)".
Also if response comes too quick, then view changes to loading view after it received the answer from request.
If list of attachments was updated from request callback, then it should not be updated second time.
Here it seems, that there is something on loading, but request is already finished.
How could be Inbox extended, to update the attachment header and content after request is ready?
used SAPUI5-Version: 1.71.4
You are using the standard bsp-application ca_fiori_inbox?
You didn't create an extension project of the application ca_fiori_inbox with custom coding?
If that's the case, it's a bug in an standard application delivered by the SAP. SAP releases so called notes to fix bugs in their standard applications.
You can import notes in your system via the transaction SNOTE. May ask a SAP Basis Administrator from your company for help.
The following notes exactly describe your problem
2873960
2823664
2916255
2901520
If you already extended the SAP standard application(MyInbox) without using ExtensionPoints codechanges in the standard application will not affect your custom extension.
When overriding a controller method, any functionality that was previously provided by it is no longer available. Likewise, any future changes made to the original controller method implementation will not be reflected in the custom controller.
In this case you could still implement the note and check the changes in the standard controller vs. your custom controller on your system and change the respective lines in your custom coding.
Don't fix SAP coding. Report it and get a fix.
The Note 2873960 corrects coding in an abap class, not in the bsp-application(ca_fiori_inbox). So definitly import the note and check if it's fixing your problem.
I actually do not know, how the app works, but I want to give it a try.
Since it is an asynchronous function, you can always also wait for the function until it is done. So in your case, you could try to set an await keyword in front of the function.
await fnFetchDataOnTabSelect("Attachments");
This will now wait on this position until it has finished the function call before it will call the next functions. In addition to that you also need to set the upper function onTabSelect to async. So in the end it should look something like this.
onTabSelect: async function() {
// ...
this.fnDelegateAttachmentsCreation();
await this.fnFetchDataOnTabSelect("Attachments");
this.fnHandleAttachmentsCountText("Attachments");
this.fnHandleNoTextCreation("Attachments");
// ...
}
Although the Web IDE maybe shows you errors, it does work, since it is an official JavaScript API.

Is there a way to execute a custom action through the CodeAction request?

I want to initiate a user action from Visual studio code. which would read the current opened text document, extract a piece of code by some kind of UI action (a custom button, or through CodeAction if possible), send it to the server using the Language Server Protocol, does some work and returns some output back to client.
I've read the Language Server Protocol specifications for CodeAction but its normally used only for quickfixes and refactoring, can i use it for any other custom action? If so, how?
Code actions can invoke arbitrary client-side commands when they're executed:
export interface CodeAction {
[...]
/**
* A command this code action executes. If a code action
* provides an edit and a command, first the edit is
* executed and then the command.
*/
command?: Command;
}
You can register new commands using the vscode.commands namespace.
[...] send it to the server using the Language Server Protocol, does some work and returns some output back to client
For this part, you can use custom methods to send data back and forth between the language server and the VSCode extension:
Vscode Language Client extension - how to send a message from the server to the client?
visual studio language extension, how do I call my own functions?
Both of these things of course make your language server much less compatible with clients other than VSCode. Are you sure you need client-side logic for this?

Persistently Filtering Out Application Traffic in Fiddler

Whenever I start Fiddler, I see traffic from all of the applications on my system but it's very rarely the case that I want this. Usually what I want is to only see requests made by applications I am debugging. In order to achieve this, I leave Fiddler running all the time and whenever I want to see what happened with a request I can just open it up and see.
I can filter requests by right-clicking on an entry -> Filter -> Hide '<application name>'. Although this works fine, it is cleared when Fiddler is restarted.
How can I persist filters that filter out traffic from a certain application?
I tried using the Filters tab but this is very limited and one of the missing features is what I detailed above.
This can be achieved by creating custom rules. In order to do this, in Fiddler, go to Rules -> Customize Rules. You can choose Yes to install the FiddlerScript Editor plugin if you want but this is not necessary. Just click No when asked and a file named CustomRules.js will be opened using Notepad.
This file allows you to program all sorts of rules into Fiddler, from adding headers to outgoing requests to monitoring the time taken for a response to be received. Further details on it can be found here.
In order to filter out a certain application, scroll down to the OnBeforeRequest method and paste the following code in:
if (oSession["X-PROCESSINFO"] && (
oSession["X-PROCESSINFO"].StartsWith("firefox") ||
oSession["X-PROCESSINFO"].StartsWith("outlook") ||
false))
{
oSession["ui-hide"] = "FiddlerScript> Hiding unimportant process";
}
This piece of code tells Fiddler to hide all requests coming from Mozilla Firefox or Microsoft Outlook. If you want to add / update / delete any application here, all you need to do is copy / update / delete lines that contain the StartsWith method.
The first condition will filter out all the requests that do not come from an application. This is the case for requests made from Fiddler's Composer tab.

Execute code upon content-changes in TYPO3

Is it possible to notice if the content changed in the Backend and then, for example, to send a mail?
In other words, can I somehow notice who modified the contents in the backend and then automatically send an email?
Yes. When content is changed in the backend, several hooks are called before and after the database operations. You can register for each of those hooks. The class you want to have a look at for the right hook is \TYPO3\CMS\Core\DataHandling\DataHandler.
You can e.g. register a class for the processDatamap_afterDatabaseOperations hook by adding the class name to the array
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']
in your ext_localconf.php.
You can find more about hooks in TYPO3 here: https://usetypo3.com/signals-and-hooks-in-typo3.html

Asp.Net and External DLL

i'm writing a web application that works with an external dll (activex),
the dll was written by skype developers,
the problem is that,
in a case of any event (status changing, attachment, etc..) in the client side, a delegate needs to be call on the server side.
so when i'm changing a status in the skype program, it seem that a postback really happen but there is no affect on the client side.
for example , i'm trying to change a label content by his new value from the server side (using label that runat server) but nothing change.
i succedded to make a java script interval
so when it recognize any changes
it replace the content of the label.
i preffer not to use it because the dll already support that events.
thanks in advance.
It seems that your problem is simulating a post-back to make the label change its contents. If so, this link might be helpful:
Using doPostBack Function in asp.net