Ver código fonte

eliminate "comment limited" notice

Mike L 3 anos atrás
pai
commit
2b3a8c36f3
2 arquivos alterados com 6 adições e 1 exclusões
  1. 3 0
      dist/webshot.js
  2. 3 1
      src/webshot.ts

+ 3 - 0
dist/webshot.js

@@ -113,6 +113,9 @@ class Webshot extends CallableInstance {
                         if (time) {
                             time.innerHTML = time.title + ' ' + new Date(time.dateTime).toLocaleTimeString().slice(0, -3);
                             time.parentElement.parentElement.style.margin = '-24px 2px 12px';
+                            const element = time.parentElement.parentElement.nextElementSibling;
+                            if (element)
+                                element.style.display = 'none';
                         }
                     }))
                         .then(() => utils_1.chainPromises(morePostProcessings.map(func => () => func(page))))

+ 3 - 1
src/webshot.ts

@@ -143,7 +143,7 @@ class Webshot extends CallableInstance<[LazyMediaItem[], (...args) => void, numb
             .then(() => page.addStyleTag({
               content: '*{font-family:-apple-system,".Helvetica Neue DeskInterface",Hiragino Sans,Hiragino Sans GB,sans-serif!important}',
             }))
-            // display absolute date and time
+            // display absolute date and time and remove "comment limited" notice
             .then(() => page.evaluate(() => {
               let time: HTMLTimeElement;
               time = document.querySelector('div>div>time');
@@ -152,6 +152,8 @@ class Webshot extends CallableInstance<[LazyMediaItem[], (...args) => void, numb
               if (time) {
                 time.innerHTML = time.title + ' ' + new Date(time.dateTime).toLocaleTimeString().slice(0, -3);
                 time.parentElement.parentElement.style.margin = '-24px 2px 12px';
+                const element = time.parentElement.parentElement.nextElementSibling as HTMLElement;
+                if (element) element.style.display = 'none';
               }
             }))
             .then(() => chainPromises(morePostProcessings.map(func => () => func(page))))