Remove erroneous javascript - sitefinity

Just fired up a test instance of Sitefinity. Seeing some injected JS. Searching for this JS reveals nothing relevant.
How do I remove this code? It is not in any of my templates:
<script type="text/javascript" src="/WebResource.axd?d=...;t=636632737400000000"></script>
And also:
StatsClient.LogVisit(..., ...)
I want no javascript on the page at all.

To disable the StatsClient code, you need to go to
Administration > Settings > Advanced > Statistics and then select None for the Page visit log mode property. Restart the site.
Sitefinity is logging all page visits in case you want later to create personalization segments based on that.
As for the webresource.axd - it could be anything so you should inspect the contents of that file and then will see how to remove it.

Related

Blocking some GTM tags when running TestCafe tests - use the dataLayer?

Wondering the best way to prevent a GTM tag from firing. I found https://rbardini.com/automating-gtm-data-layer-tests/ which tags about fetching the dataLayer variable and comparing it in an assertion, but this looks like a clumsy approach when you want to write to the dataLayer on every page.
For example, it suggests:
const getDataLayer = ClientFunction(() => window.dataLayer)
We use Google Tag Manager to automatically load tags on our website. Unfortunately one of them is CloudIQ (from PayPal) which pops up an iframe overlay offering a newsletter signup or ability to save your shopping basket. The Trigger in our GTM setup for that tag is simply 'All Pages'. When it pops up it generally blocks our test because Selectors cannot be clicked.
Our page flow is over several pages of an online shop, e.g.:
visit home page, click a product - navigates to a product page
click some options on the product page, then add to cart
go through checkout flow
So there might be many pages visited due to click actions.
There is an ability in GTM to define Variables and then use them in Exceptions for a tag, so I could prevent the CloudIQ tag firing either via a/ a global variable or b/ a dataLayer variable. However, I can't see how to elegantly get these set for each page visited during my test, such that they would exist when the GTM examines variables in order to block a Tag from being loaded. Fixture.beforeEach isn't right because it would only run once per fixture, and any data it set on the page's scope would be lost as soon as a page navigation occurs.
Anyone got experience of this sort of thing?
(The alternative of course is to detect the overlay, use switchToIframe to switch into the CloudIQ iframe and close it manually, but it pops up quite erratically and I'd prefer to simply disable the Tag altogether during tests as it's not core functionality of our website that we need to test.)
One way would be to set a custom user agent string to your test suite, create a custom javascript variable that returns the value for navigator.useragent, and make an exception trigger that blocks the tag.
Or any variation on that theme - set a cookie, use a url parameter, or if you test suite allow inject a global js variable, and check for the value in an exception trigger.
There is no need to avoid firing of events on the client side. Just mock the service routes for Google Tag Manager and CloudIQ and imitate correct responses for them.

Removing Ektron widget

I believe there is a widget on my page that is causing unbelievably slow page loads. I have narrowed down the exact page it is, and I have about 8 widgets on it. I am trying to disable the widgets one by one, but am having a tough time figuring it out. In the documentation to explains how to remove a widget, but I would like to only temporarily disable them.
These widgets are on PageBuilders, and I have tried to deselect them in Settings > Configuration > Template Configuration but this does not seem to disable it.
Is there a different way to disable widgets?
I am using Ektron 8.6.1
To disable the widget, you could remove the .ascx file from the /widgets folder. The Page should open but report "Cannot load widget" where that widget would appear on the page.
The template configuration setting only prevents you from adding that widget to a new page.

how to dynamically rewrite the url?

original url
http://wwww.mydomain.com/image.php?id=13&cat=4&type=3$date=2011-03-14
i want to modify this dynamic url to something like this
http://www.mydomain.com/imageid/imagetitle (no php/html extension at the end )
plz if someone could help me in this , i have tried several online generators but my modification is little different.
I don't know how to write mods .
well, to get it you could need a page that redirects you to another location.
in the head section of your html page you have to specify a meta tag like it:
<meta http-equiv="refresh" content="0; http://www.mydomain.com/imageid/imagetitle" />
when you land on that page, it counts to seconds you specified in the first argument of content (in this case 0 seconds) and opens the new page passed as the second parameter.
a easy thing you could do to avoid extensions to be visible on the address bar of your browser is to create a folder in your web server (in your case "imagetitle") and put inside it an index page for example "index.html" which is the page loaded by default when a user aims to that link

wiki custom page layout freez the save,checkout, and page layout option?

I have developed the Custom Wiki page layout and deployed it successfully but once I changed the layout its freeze pagelayout, save, checkout options?
I have checked with admin/siteowner user
Run on IE, Chrome, etc browsers also.
This is usually caused by one of or a few different issues, all of which are nearly impossible to troubleshoot remotely.
You did not include certain required layout assets.
Improper markup
Invalid web part references.
Invalid system layout id references.
A couple of techniques that can be used to diagnose this further.
Start with the default template in sharepoint designer and keep changing slowly until you reach your final layout.
Wait for the page to timeout or view the console in developer tools to see if there is any details.

Modify login page appearance, run javascript/jquery when login fails

I want to modify the appearance of the login page. I've added some jquery and javascript to DesktopModules/AuthenticationServices/DNN/Login.ascx so i could have a virtual keyboard which the user can use to type the username and password. The problem is that when the login fails, it seems to me that the jquery and the javascript scripts are not executed and consequently the virtual keyboard does not appear.
I've done a lot of search on this one. I'm considering making a new login module, but i'm not sure how or if this will enable me to solve the problem.
Any suggestions out there?
DNN Version: 6.1.3
I would advise against changing the core login directly, because it's considered a "core change" and would be overwritten in an upgrade. It would require that you merge your changes before upgrading every time.
Instead, if you require that level of access, I'd suggest creating your own login module.
In looking at your problem though, I don't think that's necessary. You could achieve this same effect by creating and implementing a skin widget. Skin widgets will allow you to manipulate the UI in nearly any way you can think of since you can use jQuery and inject jQuery plugins.
This is a much more elegant solution that can scale, is testable, safe against upgrades, and allows you to reuse it as needed across multiple sites and installations.
Examples of widgets and documentation can be found in the following two links:
DNN Widget Suite Project
Skin Widget Wiki Article with many linked resources
Like Will said you definitely should not edit or add code to the core files as they will get overwritten in DNN upgrades. You should be able to solve this with just Javascript, but you could also look at a 3rd party login module like this one: http://www.dnnspot.com/Modules/DotNetNuke-Custom-Login
Has features to customize the sign in view, logged in view, even error messages. So you should be able to inject different javascript as needed in different situations.
Disclaimer - I am affiliated with DNNspot.
I used this javascript On-Screen-Keyboard (OSK) which is lovely.
(http://www.greywyvern.com/code/javascript/keyboard)
I am using DNN 5.6.8 so I'm not sure if my solution works for DNN 6.x .
I modify the "page.ascx" file of the "skin" I'm using, but I think you can modify the "page.ascx" of the default skin as well.
At the top of the page.ascx, below the list of "Register"'s I wrote this:
<script type="text/javascript" src="/js/keyboard.js" charset="UTF-8"></script>
<link rel="stylesheet" type="text/css" href="/js/keyboard.css">
Those 2 files (keyboard.js and keyboard.css) are the on-screen-keyboard. You may store them in other folders than "/js" of course.
At the bottom of the page.ascx, I put this script:
<script type="text/javascript">
$(document).ready(function () {
if (document.getElementById('dnn_ctr_Login_Login_DNN_txtUsername') != null) {
$("#dnn_ctr_Login_Login_DNN_txtUsername").attr("lang", "es");
$("#dnn_ctr_Login_Login_DNN_txtPassword").attr("lang", "es");
VKI_attach(document.getElementById('dnn_ctr_Login_Login_DNN_txtUsername'));
VKI_attach(document.getElementById('dnn_ctr_Login_Login_DNN_txtPassword'));
}
});
</script>
These names: 'dnn_ctr_Login_Login_DNN_txtUsername' and 'dnn_ctr_Login_Login_DNN_txtPassword' were the ones I saw by right-clicking and "View source code" of my DNN site running, and I think there's no reason to think they can be different in other DNN sites, but nevertheless you can check yours.
Obviously you must have jQuery active in your DNN installation. :)
That's it. It works great!!
HTH!