Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to display full article #2840

Closed
Selyjohns opened this issue Apr 22, 2022 · 16 comments
Closed

Impossible to display full article #2840

Selyjohns opened this issue Apr 22, 2022 · 16 comments

Comments

@Selyjohns
Copy link

Hello everyone,

I want to see details of current news displayed with notification ARTICLE_MORE_DETAIL or ARTICLE_TOGGLE_FULL notification, but this is not functionnal (just display black screen)

Logs

0 | mm
(node:26811) electron: Failed to load URL: https://XXX  with error:ERR_BLOCKED_BY_RESPONSE

I think this is because the website block iframe to avoid click-jacking (https://stackoverflow.com/questions/48668767/error-when-loading-an-external-url-in-an-iframe-with-electron), so there is no possibilities in this case ?

Thank you for your help !

@khassel
Copy link
Collaborator

khassel commented Oct 2, 2022

This should be possible since #2850

Can this be closed? @JosselynL

@Selyjohns
Copy link
Author

This should be possible since #2850

Can this be closed? @JosselynL

Thank you for this information.
I will try and come back to you soon with the result

@Selyjohns
Copy link
Author

@khassel
MM freshly updated, but problem is still the same with same error.
Does I need to do something ?

Thank you.

@khassel
Copy link
Collaborator

khassel commented Oct 7, 2022

Does I need to do something ?

you have to add the line httpHeaders into your config.js as provided below:

let config = {
	address: "localhost",
	port: 8080,
	httpHeaders: { contentSecurityPolicy: false, crossOriginOpenerPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false, frameguard: false },
	...
}

@Selyjohns
Copy link
Author

	httpHeaders: { contentSecurityPolicy: false, crossOriginOpenerPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false, frameguard: false },

Thank you for your replay.
But still the same issue.

0|mm | (node:27973) electron: Failed to load URL: https://actu.fr/occitanie/toulouse_31555/***********.html with error: ERR_BLOCKED_BY_RESPONSE

@khassel
Copy link
Collaborator

khassel commented Oct 7, 2022

can you provide your config.js with the related module config so we can reproduce this error?

Please remove all private information as e.g. apikeys before ...

@Selyjohns
Copy link
Author

Selyjohns commented Oct 7, 2022

Thank you.
Here is. I've delete all modules configuration, I think you don't need it :)

/* Magic Mirror Config Sample
 *
 * By Michael Teeuw https://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information on how you can configure this file
 * see https://docs.magicmirror.builders/getting-started/configuration.html#general
 * and https://docs.magicmirror.builders/modules/configuration.html
 */
let config = {
	address: "0.0.0.0", 	// Address to listen on, can be:
							// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
							// - another specific IPv4/6 to listen on a specific interface
							// - "0.0.0.0", "::" to listen on any interface
							// Default, when address config is left out or empty, is "localhost"
	port: 8080,
	httpHeaders: { contentSecurityPolicy: false, crossOriginOpenerPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false, frameguard: false },
	basePath: "/", 	// The URL path where MagicMirror is hosted. If you are using a Reverse proxy
					// you must set the sub path here. basePath must end with a /
	ipWhitelist: [], // Set [] to allow all IP addresses
															// or add a specific IPv4 of 192.168.1.5 :
															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
															// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

	useHttps: false, 		// Support HTTPS or not, default "false" will use HTTP
	httpsPrivateKey: "", 	// HTTPS private key path, only require when useHttps is true
	httpsCertificate: "", 	// HTTPS Certificate path, only require when useHttps is true

	language: "fr",
	locale: "fr",
	logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
	timeFormat: 24,
	units: "metric",
	// serverOnly:  true/false/"local" ,
	// local for armv6l processors, default
	//   starts serveronly and then starts chrome browser
	// false, default for all NON-armv6l devices
	// true, force serveronly mode, because you want to.. no UI on this device

	modules: [
		{
      		module: 'MMM-ModuleScheduler',
  		},
		{
            module: 'MMM-Carousel',
		},
		{
		module: 'MMM-Remote-Control',
		// uncomment the following line to show the URL of the remote control on the mirror
		// position: 'bottom_left',
		// you can hide this module afterwards from the remote control itself
    		config: {
        		customCommand: {},  // Optional, See "Using Custom Commands" below
        		showModuleApiMenu: true, // Optional, Enable the Module Controls menu
        		secureEndpoints: true, // Optional, See API/README.md
        		// uncomment any of the lines below if you're gonna use it
        		// customMenu: "custom_menu.json", // Optional, See "Custom Menu Items" below
        		apiKey: "***", // Optional, See API/README.md for details
        		// classes: {} // Optional, See "Custom Classes" below
					}
		},
		{
			module: "alert",
		},
		{
			module: "updatenotification",
			position: "top_center",
		},
		{
			module: "clock",
			position: "top_left"
		},
		{
			module: "calendar",
		},
		{
			module: "weather",
		},
		{
			module: "weather",
		},
		{
			module: "MMM-VigilanceMeteoFrance",
		},
        {
            module: 'compliments',
            //position: 'lower_third',
            position: 'middle_center',
				config: {
					morningStartTime:5,
					morningEndTime:12,
					afternoonStartTime:12,
					afternoonEndTime:19,
					remoteFile: 'compliments.json'
						}
        },
        {
			module: 'MMM-Jeedom',
			
        },
        {
			module: 'MMM-Jeedom',
        },
		{
            module: 'MMM-Jeedom',
		},
		{
			module: 'MMM-Jeedom',
        },
		{
			module: "newsfeed",
			position: "bottom_bar",
			config: {
				feeds: [
				/*	{
						title: "La depeche",
						url: "https://www.ladepeche.fr/rss.xml"
					},*/
					{
						title: "Actu Toulouse",
						url: "https://actu.fr/toulouse/rss.xml"
					},
					{
						title: "Netflix News",
						url: "https://www.netflix-news.com/feed/"
					},
					{
						title: "Cookomix : Les dernières recettes publiées",
						url: "https://cookomix.com/feed/"
					}
				],
				showSourceTitle: true,
				showPublishDate: true,
				broadcastNewsFeeds: true,
				broadcastNewsUpdates: true,
				ignoreOldItems: true,
			}
		},
		{
            module: 'MMM-Jeedom',
        },
		{
			module: 'MMM-Jeedom',
		},
        {
            module: 'EXT-Screen',
        },
	]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

@khassel
Copy link
Collaborator

khassel commented Oct 7, 2022

you can remove the httpHeaders stuff from above, this is for another usecase (embedding mm in another website).

As a first hack you can edit modules/default/newsfeed/newsfeed.js at about line nr. 150 and replace

	getActiveItemURL: function () {
		return typeof this.newsItems[this.activeItem].url === "string" ? this.newsItems[this.activeItem].url : this.newsItems[this.activeItem].url.href;
	},

with

	getActiveItemURL: function () {
		const urlPrefix = location.protocol + "//" + location.host + "/cors?url=";
		return typeof this.newsItems[this.activeItem].url === "string" ? urlPrefix + this.newsItems[this.activeItem].url : urlPrefix + this.newsItems[this.activeItem].url.href;
	},

Let me know if this works.

@Selyjohns
Copy link
Author

Hi,
Yeah, this works better now ! Thank you 👍
ARTICLE_MORE_DETAILS or ARTICLE_TOGGLE_FULL have the same result.
ARTICLE_MORE_DETAILS again and the page scroll down, but I can't go to the end of the page. It is blocking before, but I think this is another issue.

pm2 logs when I request ARTICLE_MORE_DETAILS for the first time

0|mm  | [08.10.2022 12:07.39.753] [LOG]
0|mm  | cors url: https://actu.fr/occitanie/toulouse_31555/bal-concerts-gratuits-expo-vide-dressing-10-sorties-a-faire-a-toulouse-ce-week-end_54337049.html
0|mm  | [08.10.2022 12:07.40.660] [LOG]
0|mm  | cors url: https://actu.fr/occitanie/toulouse_31555/top-14-un-stade-toulousain-en-grande-forme-recoit-clermont-pas-en-reussite-a-l-exterieur_54350507.html
0|mm  | [08.10.2022 12:07.41.208] [ERROR]
0|mm  | (node:28856) electron: Failed to load URL: https://actu.fr/checksso.html#error=login_required&state=d54f557c-e474-441c-8e02-eac37782bf62 with error: ERR_BLOCKED_BY_RESPONSE

The displayed article is the second URL, I don't know why the URL of previous article is in log.

@rejas
Copy link
Collaborator

rejas commented Oct 8, 2022

So, this issued can be closed now?

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 8, 2022

can't scroll down is probably the main.css overflow:hidden

@khassel
Copy link
Collaborator

khassel commented Oct 8, 2022

So, this issued can be closed now?

not yet, have to create a PR for this ...

@Selyjohns
Copy link
Author

Hello

@khassel TY for the PR
@sdetweil How can I check this ?

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 9, 2022

@JosselynL find a big article and cause that to be displayed. did it get clipped at the bottom?
will u have a mouse? if so, scroll down with overflow:hidden turned off(commented out)

@Selyjohns
Copy link
Author

@JosselynL find a big article and cause that to be displayed. did it get clipped at the bottom? will u have a mouse? if so, scroll down with overflow:hidden turned off(commented out)

Just tried with Remote Control (and so a mouse).
When the scroll down is blocked with "ARTICLE_MORE_DETAILS", I can continue to scroll down with the mouse, until the end of the page.
Comment or uncomment the overflow has no impact.


html {
  cursor: none;
/*  overflow: hidden;*/

rejas pushed a commit that referenced this issue Oct 17, 2022
solves #2840 as far as possible. There could still be errors on the
embedded iframe when the owner of the site has set `X-Frame-Options` or
`Access-Control-Allow-Origin` headers (as already mentioned in the
docs).
MichMich added a commit that referenced this issue Jan 1, 2023
## [2.22.0] - 2023-01-01

Thanks to: @angeldeejay, @buxxi, @dariom, @dWoolridge,
@KristjanESPERANTO, @MagMar94, @naveensrinivasan, @retroflex, @SkySails
and @tom.

Special thanks to @khassel, @rejas and @sdetweil for taking over most
(if not all) of the work on this release as project collaborators. This
version would not be there without their effort. Thank you!

### Added

- Added test for remoteFile option in compliments module
- Added hourlyWeather functionality to Weather.gov weather provider
- Removed weatherEndpoint definition from weathergov.js (not used)
- Added css class names "today" and "tomorrow" for default calendar
- Added Collaboration.md
- Added new github action for dependency review (#2862)
- Added a WeatherProvider for Open-Meteo
- Added Yr as a weather provider
- Added config options "ignoreXOriginHeader" and
"ignoreContentSecurityPolicy"

### Removed

- Removed usage of internal fetch function of node until it is more
stable

### Updated

- Cleaned up test directory (#2937) and jest config (#2959)
- Wait for all modules to start before declaring the system ready
(#2487)
- Updated e2e tests (moved `done()` in helper functions) and use es6
syntax in all tests
- Updated da translation
- Rework weather module
- Make sure smhi provider api only gets a maximum of 6 digits
coordinates (#2955)
  - Use fetch instead of XMLHttpRequest in weatherprovider (#2935)
  - Reworked how weatherproviders handle units (#2849)
  - Use unix() method for parsing times, fix suntimes on the way (#2950)
  - Refactor conversion functions into utils class (#2958)
- The `cors`-method in `server.js` now supports sending and recieving
HTTP headers
- Replace `…` by `…`
- Cleanup compliments module
- Updated dependencies including electron to v22 (#2903)

### Fixed

- Correctly show apparent temperature in SMHI weather provider
- Ensure updatenotification module isn't shown when local is _ahead_ of
remote
- Handle node_helper errors during startup (#2944)
- Possibility to change FontAwesome class in calendar, so icons like
`fab fa-facebook-square` works.
- Fix cors problems with newsfeed articles (as far as possible), allow
disabling cors per feed with option `useCorsProxy: false` (#2840)
- Tests not waiting for the application to start and stop before
starting the next test
- Fix electron tests failing sometimes in github workflow
- Fixed gap in clock module when displayed on the left side with
displayType=digital
- Fixed playwright issue by upgrading to v1.29.1 (#2969)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Malte Hallström <46646495+SkySails@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: dWoolridge <dwoolridge@charter.net>
Co-authored-by: Johan <jojjepersson@yahoo.se>
Co-authored-by: Dario Mratovich <dario_mratovich@hotmail.com>
Co-authored-by: Dario Mratovich <dario.mratovich@outlook.com>
Co-authored-by: Magnus <34011212+MagMar94@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: buxxi <buxxi@omfilm.net>
Co-authored-by: Thomas Hirschberger <47733292+Tom-Hirschberger@users.noreply.github.com>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com>
@khassel
Copy link
Collaborator

khassel commented Jan 3, 2023

the main issue is solved with release v2.22.0.

ARTICLE_MORE_DETAILS again and the page scroll down, but I can't go to the end of the page. It is blocking before, but I think this is another issue.

If this is still a problem please open a new issue, thanks.

@khassel khassel closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants