@kangsicj/dcinsideenhancer 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  // @name DCInside Enhancer
3
3
  // @name:ko 디시 인핸서
4
4
  // @namespace https://github.com/kangsicj/DCInsideEnhancer
5
- // @version 1.3.5
5
+ // @version 1.3.7
6
6
  // @description DCInside filter & enhancer — mobile & PC. Block users/words/heads/notices/images & GIFs across posts, infinite list, zoom viewer, theme sync, encrypted multi-device sync (no account, no tracking).
7
7
  // @description:ko 디시인사이드 차단·편의 기능 (모바일·PC) - 유저·단어(제목/본문)·말머리·공지 차단, 같은/비슷한 이미지·움짤 모든 글 차단, 디시콘 제거, 차단 미디어 데이터 절약, 목록 자동 보충·무한 스크롤·뒤로 가기 위치 복원, 스크랩, 이미지 확대뷰 개선, 야간모드 자동 연동, 암호화 기기 간 동기화 (계정 없음·추적 없음)
8
8
  // @author kangsicj
@@ -2,7 +2,7 @@
2
2
  // @name DCInside Enhancer
3
3
  // @name:ko 디시 인핸서
4
4
  // @namespace https://github.com/kangsicj/DCInsideEnhancer
5
- // @version 1.3.5
5
+ // @version 1.3.7
6
6
  // @description DCInside filter & enhancer — mobile & PC. Block users/words/heads/notices/images & GIFs across posts, infinite list, zoom viewer, theme sync, encrypted multi-device sync (no account, no tracking).
7
7
  // @description:ko 디시인사이드 차단·편의 기능 (모바일·PC) - 유저·단어(제목/본문)·말머리·공지 차단, 같은/비슷한 이미지·움짤 모든 글 차단, 디시콘 제거, 차단 미디어 데이터 절약, 목록 자동 보충·무한 스크롤·뒤로 가기 위치 복원, 스크랩, 이미지 확대뷰 개선, 야간모드 자동 연동, 암호화 기기 간 동기화 (계정 없음·추적 없음)
8
8
  // @author kangsicj
@@ -37,7 +37,7 @@
37
37
  window.__dcInsideEnhancer = true;
38
38
  window.__dcRefinery = true;
39
39
 
40
- const SCRIPT_VERSION = '1.3.5';
40
+ const SCRIPT_VERSION = '1.3.7';
41
41
  const PROJECT_URL = 'https://github.com/kangsicj/DCInsideEnhancer';
42
42
  const DONATE_URL = 'https://fairy.hada.io/@kangsicj';
43
43
  const DONATE_URL_BMC = 'https://buymeacoffee.com/kangsicj';
@@ -5872,12 +5872,36 @@
5872
5872
  });
5873
5873
  };
5874
5874
 
5875
+ const zoomSourceUrl = el => {
5876
+ const rel = el.getAttribute('data-rel');
5877
+ let url = rel && rel !== 'null' ? rel : el.getAttribute('data-original') || el.getAttribute('ori-data');
5878
+
5879
+ if (el.hasAttribute('data-gif')) {
5880
+ url = el.getAttribute('data-gif');
5881
+ }
5882
+
5883
+ return url || '';
5884
+ };
5885
+
5886
+ const findZoomSource = (mediaEl, slide, popup, zoomSources) => {
5887
+ const slideSrc = mediaEl.getAttribute('src') || '';
5888
+ const bySrc = slideSrc && zoomSources.find(el => zoomSourceUrl(el) === slideSrc);
5889
+
5890
+ if (bySrc) {
5891
+ return bySrc;
5892
+ }
5893
+
5894
+ const index = slide && popup ? [...popup.querySelectorAll('.swiper-slide')].indexOf(slide) : -1;
5895
+ const listed = zoomSources.filter(el => zoomSourceUrl(el));
5896
+
5897
+ return index >= 0 ? listed[index] || null : null;
5898
+ };
5899
+
5875
5900
  const applyZoomSlideBlock = (element, zoomSources) => {
5876
5901
  const mediaEl = getMediaElement(element);
5877
5902
  const slide = mediaEl.closest('.swiper-slide');
5878
5903
  const popup = mediaEl.closest(ZOOM_POPUP_SELECTOR);
5879
- const index = slide && popup ? [...popup.querySelectorAll('.swiper-slide')].indexOf(slide) : -1;
5880
- const source = index >= 0 ? zoomSources[index] : null;
5904
+ const source = findZoomSource(mediaEl, slide, popup, zoomSources);
5881
5905
  const ids = [...new Set([...resolveMediaIds(mediaEl), ...(source ? resolveMediaIds(source) : [])])];
5882
5906
 
5883
5907
  if (!ids.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kangsicj/dcinsideenhancer",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "DCInside filter & enhancer userscript for mobile and PC (디시인사이드 차단·편의 유저스크립트)",
5
5
  "license": "GPL-3.0-only",
6
6
  "author": "kangsicj",